VYPR
Unrated severityNVD Advisory· Published Nov 22, 2023· Updated Feb 13, 2025

Vim has heap-use-after-free at /src/charset.c:1770:12 in skipwhite

CVE-2023-48706

Description

Vim versions prior to 9.0.2121 contain a heap-use-after-free in ex_substitute when a recursive :s command frees memory later accessed by the initial :s, potentially causing a crash.

AI Insight

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

Vim versions prior to 9.0.2121 contain a heap-use-after-free in ex_substitute when a recursive :s command frees memory later accessed by the initial :s, potentially causing a crash.

Vulnerability

Vim versions prior to 9.0.2121 contain a heap-use-after-free vulnerability in the ex_substitute() function. The bug is triggered when a user executes a :s substitution command for the first time in a session and includes a sub-replace-special atom (e.g., ~\=) that causes a recursive :s call. The recursive call can free memory that the initial call later accesses, leading to a use-after-free condition [1][2][4].

Exploitation

Exploitation requires the user to run a crafted :s command as the first substitution in a Vim session. The command must contain a sub-replace-special atom that invokes a recursive substitution, causing the use-after-free. The attacker must convince the user to open a malicious file or execute the command directly. The process is delicate and may not always succeed, but can result in a crash [1][4].

Impact

Successful exploitation leads to a heap-use-after-free, which can cause Vim to crash or potentially allow arbitrary code execution if the freed memory is controlled. The impact is considered low because the attacker requires user interaction and the exploitation is tricky to reproduce reliably [1][4].

Mitigation

The vulnerability is fixed in Vim version 9.0.2121 [2]. Users should update to this version or later. No workaround is available for unpatched versions. The issue is not listed in CISA's Known Exploited Vulnerabilities catalog as of publication [1][4].

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

27

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

8

News mentions

0

No linked articles in our index yet.