Incorrect Calculation of Buffer Size in vim/vim
Description
In vim prior to 9.0.1378, incorrect buffer size calculation in virtual editing mode can cause illegal memory access.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
In vim prior to 9.0.1378, incorrect buffer size calculation in virtual editing mode can cause illegal memory access.
Vulnerability
The vulnerability is an incorrect buffer size calculation in vim's virtual editing mode. In the op_yank function, when calculating bd.startspaces, the value could become negative, leading to an out-of-bounds memory access. This occurs in versions prior to 9.0.1378 when virtual editing is enabled (set virtualedit=all) and a yank operation is performed on a line with certain column offsets. The official patch [4] adds a check to clamp bd.startspaces to zero if negative.
Exploitation
An attacker can exploit this by providing a specially crafted text file that, when opened and yanked by a victim using virtual editing, triggers the negative startspaces condition. The attacker requires the victim to have virtual editing enabled and to perform a yank operation. No network access is needed; local file interaction suffices. The exploit sequence involves opening the malicious file, entering virtual edit mode, and executing a yank command (e.g., y or Y).
Impact
Successful exploitation results in an illegal memory access, which can cause a denial of service (crash) or potentially arbitrary code execution, depending on how the memory corruption is leveraged. The commit description [4] explicitly mentions "illegal memory access". The attacker gains no direct privileges but may leverage the crash or code execution to compromise the vim process.
Mitigation
The vulnerability is fixed in vim version 9.0.1378, released on or around March 2023. Users should update to this version or later. No practical workaround exists aside from disabling virtual editing (set novirtualedit) or avoiding untrusted files, but upgrading is recommended. The fix is available in the official vim repository [4]. Fedora packages may have updates as well, but the advisory pages are inaccessible.
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- osv-coords36 versionspkg:apk/chainguard/vimpkg:apk/chainguard/vim-docpkg:apk/wolfi/vimpkg:apk/wolfi/vim-docpkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/vim&distro=openSUSE%20Tumbleweedpkg:rpm/suse/vim&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/vim&distro=SUSE%20Enterprise%20Storage%207.1pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-ESPOSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP3-LTSSpkg: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%20Micro%205.4pkg: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-ESPOSpkg: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%2015%20SP1-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP3-LTSSpkg: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%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP1pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP2pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%20for%20SAP%20Applications%2015%20SP3pkg:rpm/suse/vim&distro=SUSE%20Manager%20Proxy%204.2pkg:rpm/suse/vim&distro=SUSE%20Manager%20Server%204.2pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 9.0.1378-r0+ 35 more
- (no CPE)range: < 9.0.1378-r0
- (no CPE)range: < 9.0.1378-r0
- (no CPE)range: < 9.0.1378-r0
- (no CPE)range: < 9.0.1378-r0
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1392-1.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-150000.5.37.1
- (no CPE)range: < 9.0.1386-17.15.4
- (no CPE)range: < 9.0.1386-17.15.4
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
6- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/DIAKPMKJ4OZ6NYRZJO7YWMNQL2BICLYV/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/IE44W6WMMREYCW3GJHPSYP7NK2VT5NY6/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/X4KDAU76Z7QNSPKZX2JAJ6O7KIEOXWTL/mitrevendor-advisory
- lists.debian.org/debian-lts-announce/2023/06/msg00015.htmlmitremailing-list
- github.com/vim/vim/commit/c99cbf8f289bdda5d4a77d7ec415850a520330bamitre
- huntr.dev/bounties/7e93fc17-92eb-4ae7-b01a-93bb460b643emitre
News mentions
0No linked articles in our index yet.