VYPR
Unrated severityNVD Advisory· Published Jun 2, 2022· Updated Aug 3, 2024

Use After Free in vim/vim

CVE-2022-1968

Description

A use-after-free vulnerability in Vim prior to 8.2.5050 allows arbitrary code execution via a crafted file.

AI Insight

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

A use-after-free vulnerability in Vim prior to 8.2.5050 allows arbitrary code execution via a crafted file.

Vulnerability

A use-after-free vulnerability exists in Vim's find_pattern_in_path function, which is used when searching for patterns in included files. The function calls ml_get() to retrieve a line, but the returned pointer can become invalid if the regexp engine modifies the buffer (e.g., by using a mark). This leads to use of freed memory. The issue affects Vim versions prior to 8.2.5050 [2].

Exploitation

An attacker can exploit this vulnerability by crafting a file that, when opened and searched (e.g., via :isearch or pattern matching), triggers the use-after-free. No special privileges are required; the victim only needs to open the malicious file in Vim and perform a search operation [2].

Impact

Successful exploitation could lead to arbitrary code execution or denial of service, depending on how the freed memory is reused. The attacker gains the ability to execute code in the context of the Vim process [2][3][4].

Mitigation

The vulnerability is fixed in Vim patch 8.2.5050 [2]. Users should upgrade to Vim 8.2.5050 or later. Apple included a fix in macOS Ventura 13 [1]. Gentoo recommends upgrading to >=app-editors/vim-9.0.0060 (GLSA 202208-32) or >=app-editors/vim-9.0.1157 (GLSA 202305-16) [3][4]. No workaround is available.

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

Affected products

39

Patches

0

No patches discovered yet.

Vulnerability mechanics

Synthesis attempt was rejected by the grounding validator. Re-run pending.

References

9

News mentions

0

No linked articles in our index yet.