Improper Validation of Specified Quantity in Input in vim/vim
Description
Vim before 9.0.0218 fails to validate a column number in display_dollar, leading to a read before the start of a line.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Vim before 9.0.0218 fails to validate a column number in display_dollar, leading to a read before the start of a line.
Vulnerability
The vulnerability resides in the display_dollar function in edit.c of Vim prior to version 9.0.0218. The function accepts a col parameter of type colnr_T and uses it directly to access the current line, without first checking whether the value is negative. This missing validation means that if a caller passes a negative column number, the function can read memory before the start of the line buffer. The issue was introduced through an incomplete refactor or coding error [1].
Exploitation
An attacker who can supply crafted input that triggers display_dollar with a negative column value can exploit this flaw. According to the reference, the test case Test_cmdwin_virtual_edit triggers the condition by setting 'virtualedit' to all and using a command-line window operation (normal q/s), which causes the negative column to be passed. No special privileges beyond normal Vim editing capabilities are required, but the attacker must be able to open a file and execute commands that lead to the vulnerable code path [1].
Impact
Successful exploitation results in an out-of-bounds read from memory preceding the start of the line buffer. This can lead to information disclosure (reading adjacent or unrelated memory) or a crash (denial of service). In some configurations, this may be leveraged for further exploitation, though the primary impact is a denial of service or leak of sensitive data [1].
Mitigation
A fix was introduced in Vim version 9.0.0218, released on 2022-08-17. The patch in commit e98c88c44c308edaea5994b8ad4363e65030968c adds a bounds check: col = col_arg < 0 ? 0 : col_arg; to ensure the column number is non-negative. Users should upgrade to Vim 9.0.0218 or later. For users of Gentoo Linux, the advisory GLSA 202305-16 (referenced in [4]) provides updates to versions 9.0.1157 for Vim, gVim, and vim-core. No workaround is available for unpatched versions [1][4].
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- osv-coords37 versionspkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.3pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.2pkg: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
< 9.0.0313-150000.5.25.1+ 36 more
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0224-1.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.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: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0814-17.9.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.1
- (no CPE)range: < 9.0.0313-150000.5.25.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 validation of a negative column argument in `display_dollar` allows reading before the start of the line buffer."
Attack vector
An attacker can trigger this vulnerability by crafting input that causes Vim to call `display_dollar` with a negative column value. The proof-of-concept test in the patch uses `set ve=all cpo+=$` followed by `silent normal q/s` to reproduce the issue [ref_id=1]. This causes reading before the start of the line, which may lead to information disclosure or a crash.
Affected code
The vulnerability is in the `display_dollar` function in Vim's source code. The function accepts a `colnr_T col` parameter that can be negative, and it uses this value directly without validation, leading to out-of-bounds memory access. The patch renames the parameter to `col_arg` and adds a guard: `colnr_T col = col_arg
What the fix does
The patch adds a bounds check at the start of `display_dollar`: if the column argument is negative, it is clamped to 0. This prevents the function from reading memory before the beginning of the line buffer. The patch also renames the parameter from `col` to `col_arg` to avoid shadowing the local variable `col` that now holds the clamped value [ref_id=1].
Preconditions
- inputThe user must open a file or input that triggers the vulnerable code path in Vim
- configThe 'virtualedit' option must be set to 'all' and 'cpoptions' must include '$'
Reproduction
Run the following in Vim: `:enew!`, `:set ve=all cpo+=$`, `:silent normal q/s`. This triggers the out-of-bounds read in `display_dollar` [ref_id=1].
Generated on May 28, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
5- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/C72HDIMR3KTTAO7QGTXWUMPBNFUFIBRD/mitrevendor-advisory
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/XWOJOA7PZZAMBI5GFTL6PWHXMWSDLUXL/mitrevendor-advisory
- security.gentoo.org/glsa/202305-16mitrevendor-advisory
- github.com/vim/vim/commit/e98c88c44c308edaea5994b8ad4363e65030968cmitre
- huntr.dev/bounties/3e1d31ac-1cfd-4a9f-bc5c-213376b69445mitre
News mentions
0No linked articles in our index yet.