VYPR
Unrated severityNVD Advisory· Published Dec 3, 2022· Updated Apr 23, 2025

Heap-based Buffer Overflow in vim/vim

CVE-2022-3491

Description

A heap-based buffer overflow in Vim's compile_redir function allows reading past the end of a line.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

A heap-based buffer overflow in Vim's compile_redir function allows reading past the end of a line.

Vulnerability

A heap-based buffer overflow exists in the compile_redir function of Vim prior to version 9.0.0742 [1]. The vulnerability occurs when handling :redir END commands during function compilation. Specifically, the code did not properly skip compilation when cctx->ctx_skip was set to SKIP_YES, leading to out-of-bounds reads [1].

Exploitation

An attacker can trigger the vulnerability by providing a crafted Vim script that includes a :redir block with an END directive under conditions where ctx_skip indicates the block should be skipped [1]. This requires the victim to open the malicious file in Vim or otherwise execute the crafted script [3]. No special authentication or network access is typically needed, as Vim is commonly used to edit files locally.

Impact

Successful exploitation leads to a heap-based buffer overflow, which may result in reading past the end of the line [1]. This can cause undefined behavior, including denial of service, memory corruption, or potentially arbitrary code execution depending on the heap layout and system protections [2].

Mitigation

The vulnerability is fixed in Vim version 9.0.0742, released on 2022-08-29 [1]. Users should upgrade to at least this version. Gentoo provides an updated package >=app-editors/vim-9.0.1157 [2]. No known workaround exists for unpatched versions [2].

AI Insight generated on May 25, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected products

38

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

3

News mentions

0

No linked articles in our index yet.