Buffer Over-read in vim/vim
Description
A buffer over-read in Vim's parse_cmd_address function, fixed in version 8.2, could be triggered by a crafted address range.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
A buffer over-read in Vim's `parse_cmd_address` function, fixed in version 8.2, could be triggered by a crafted address range.
Vulnerability
A buffer over-read vulnerability exists in Vim, prior to version 8.2, specifically in the parse_cmd_address function. The issue occurs when processing malformed address ranges, such as through the ; separator, potentially reading beyond allocated memory. The problem was addressed in commit 4d97a565ae8be0d4debba04ebd2ac3e75a0c8010, which introduced a need_check_cursor flag and changed early return FAIL statements to goto theend to ensure proper cleanup [2].
Exploitation
An attacker can exploit this vulnerability by providing a crafted file containing a specially crafted address range command (e.g., using 0; range). When the file is opened or processed in Vim, the vulnerable code path in parse_cmd_address can be reached without requiring authentication or special privileges. The attacker only needs to convince a user to open the malicious file using Vim [2].
Impact
Successful exploitation could lead to arbitrary code execution or denial of service due to memory corruption. The vulnerability can be triggered remotely without authentication, potentially compromising the confidentiality, integrity, and availability of the system [1].
Mitigation
Vim patched this vulnerability in version 8.2, released with commit 4d97a565ae8be0d4debba04ebd2ac3e75a0c8010 [2]. Users should upgrade to Vim 8.2 or later. This issue is also addressed in Apple macOS Ventura 13 [1]. No other workarounds have been documented.
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
43- osv-coords41 versionspkg:rpm/almalinux/vim-commonpkg:rpm/almalinux/vim-enhancedpkg:rpm/almalinux/vim-filesystempkg:rpm/almalinux/vim-minimalpkg:rpm/almalinux/vim-X11pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/vim&distro=openSUSE%20Tumbleweedpkg:rpm/suse/vim&distro=SUSE%20Enterprise%20Storage%206pkg:rpm/suse/vim&distro=SUSE%20Enterprise%20Storage%207pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP1-ESPOSpkg: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-ESPOSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015%20SP2-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-ESPOSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20High%20Performance%20Computing%2015-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%20Module%20for%20Basesystem%2015%20SP3pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP3pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP2-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2012%20SP3-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%2015%20SP1-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP1-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-BCLpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015%20SP2-LTSSpkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Server%2015-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%2015pkg: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%20Manager%20Proxy%204.1pkg:rpm/suse/vim&distro=SUSE%20Manager%20Retail%20Branch%20Server%204.1pkg:rpm/suse/vim&distro=SUSE%20Manager%20Server%204.1pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%209pkg:rpm/suse/vim&distro=SUSE%20OpenStack%20Cloud%20Crowbar%209
< 2:8.0.1763-19.el8_6.4+ 40 more
- (no CPE)range: < 2:8.0.1763-19.el8_6.4
- (no CPE)range: < 2:8.0.1763-19.el8_6.4
- (no CPE)range: < 2:8.0.1763-19.el8_6.4
- (no CPE)range: < 2:8.0.1763-19.el8_6.4
- (no CPE)range: < 2:8.0.1763-19.el8_6.4
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 9.0.0453-2.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 8.2.5038-150000.5.21.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
Patches
0No patches discovered yet.
Vulnerability mechanics
Root cause
"Missing cursor position validation after a failed address parse in "0;" range allows a buffer over-read."
Attack vector
An attacker can supply a crafted command-line address range using the "0;" separator (e.g., `0;/PATTERN/`). When `get_address()` returns an error (eap->cmd becomes NULL), the original code immediately returned FAIL without calling `check_cursor()`. This leaves `curwin->w_cursor` pointing to an invalid line number, which later triggers a buffer over-read when Vim attempts to read or display the buffer contents at that cursor position [ref_id=1]. The attack requires the victim to execute a malicious command or open a file that triggers such an address range.
Affected code
The vulnerable code is in the `parse_cmd_address()` function in Vim's source. The function handles comma- and semicolon-separated address ranges. When `get_address()` returns an error (eap->cmd becomes NULL), the original code returned FAIL without calling `check_cursor()`, leaving the cursor at an invalid position [ref_id=1].
What the fix does
The patch replaces early `return FAIL` statements with `goto theend;` and introduces a `need_check_cursor` flag [ref_id=1]. At the new `theend:` label, if `need_check_cursor` is TRUE, `check_cursor()` is called to validate and correct the cursor position before returning. This ensures that even when address parsing fails, the cursor is never left on an illegal line, preventing the buffer over-read.
Preconditions
- inputVictim must execute a Vim command or open a file that triggers a '0;' address range with an invalid pattern.
Generated on May 28, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
10- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/OZSLFIKFYU5Y2KM5EJKQNYHWRUBDQ4GJ/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/QMFHBC5OQXDPV2SDYA2JUQGVCPYASTJB/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/TYNK6SDCMOLQJOI3B4AOE66P2G2IH4ZM/mitrevendor-advisory
- security.gentoo.org/glsa/202208-32mitrevendor-advisory
- security.gentoo.org/glsa/202305-16mitrevendor-advisory
- seclists.org/fulldisclosure/2022/Oct/28mitremailing-list
- seclists.org/fulldisclosure/2022/Oct/41mitremailing-list
- github.com/vim/vim/commit/4d97a565ae8be0d4debba04ebd2ac3e75a0c8010mitre
- huntr.dev/bounties/945107ef-0b27-41c7-a03c-db99def0e777mitre
- support.apple.com/kb/HT213488mitre
News mentions
0No linked articles in our index yet.