Heap-based Buffer Overflow in vim/vim
Description
A heap-based buffer overflow in Vim's (vim) cursor movement with folds could lead to out-of-bounds memory access, fixed in 9.0.1189.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A heap-based buffer overflow in Vim's (vim) cursor movement with folds could lead to out-of-bounds memory access, fixed in 9.0.1189.
Vulnerability
A heap-based buffer overflow vulnerability exists in the nv_scroll function in Vim prior to version 9.0.1189. When a user performs a cursor movement command (e.g., "L") on a line that is within a fold, the incomplete bounds check on curwin->w_cursor.lnum can cause it to be decremented below curwin->w_topline, leading to an out-of-bounds memory access. The issue arises because the code path for folding does not properly validate the cursor position after unfolding [2].
Exploitation
An attacker must be able to convince a Vim user to open a specially crafted file that causes the cursor to be positioned within a fold, then execute the "L" command (or another similar scroll command) to trigger the vulnerable code. No special network access or elevated privileges are required; the attack relies on user interaction [2]. The vulnerable code path is reached when hasFolding() returns a different line number and --curwin->w_cursor.lnum is performed without checking if it remains above curwin->w_topline [2].
Impact
Successful exploitation could lead to a heap-based buffer overflow, potentially allowing an attacker to cause a denial of service (application crash) or, in extreme cases, execute arbitrary code in the context of the Vim process. The impact is local to the user's session, with the attacker gaining the same privileges as the user running Vim [1][2].
Mitigation
The vulnerability is fixed in Vim version 9.0.1189, released on January 13, 2023 [2]. Users should update to the latest Vim version. Apple included the fix in macOS Ventura 13.3 as part of a broader security update [1]. No workaround is available, and the issue is not listed on the CISA Known Exploited Vulnerabilities (KEV) catalog.
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
18- osv-coords16 versionspkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.2pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Micro%205.1pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Micro%205.2pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Micro%205.3pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Real%20Time%2015%20SP3pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP4-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP5pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2012%20SP5pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 9.0.1234-150000.5.34.1+ 15 more
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-150000.5.34.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
- (no CPE)range: < 9.0.1234-17.12.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/WYC22GGZ6QA66HLNLHCTAJU265TT3O33/mitrevendor-advisory
- seclists.org/fulldisclosure/2023/Mar/17mitremailing-list
- github.com/vim/vim/commit/232bdaaca98c34a99ffadf27bf6ee08be6cc8f6amitre
- huntr.dev/bounties/550a0852-9be0-4abe-906c-f803b34e41d3mitre
- support.apple.com/kb/HT213670mitre
News mentions
0No linked articles in our index yet.