Integer Overflow in :history command in Vim
Description
Integer overflow in Vim's :history command leads to a heap-use-after-free, fixed in version 9.0.2068.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Integer overflow in Vim's `:history` command leads to a heap-use-after-free, fixed in version 9.0.2068.
Vulnerability
A heap-use-after-free vulnerability exists in Vim versions prior to 9.0.2068, triggered by an integer overflow in the :history command. The flaw resides in the get_list_range function in src/eval.c, where user-supplied arguments are parsed without overflow validation. When an overly large argument is provided, it can cause an integer overflow at src/cmdhist.c:759, leading to a use-after-free of memory originally allocated by ga_grow_inner at src/alloc.c:748 and freed in do_cmdline at src/ex_docmd.c:1010 [1]. The vulnerability is exploitable when Vim is run with -u NONE -i NONE -n -e -s -S flags and a specially crafted script file containing the :history command [1].
Exploitation
An attacker must supply a crafted argument to the :history command that overflows the accepted integer value. The proof-of-concept from [1] demonstrates the attack by executing Vim with ./bins/vim -u NONE -i NONE -n -e -s -S ./crashmin/gchar_cursor -c :qa!, which triggers the overflow. The overflow causes the memory region to be freed while still in use, leading to the use-after-free condition.
Impact
Successful exploitation results in a heap-use-after-free, which can be leveraged for arbitrary code execution or to crash Vim, leading to denial of service. The AddressSanitizer output in [1] confirms a read of size 4 on freed memory, indicating potential for information disclosure or control-flow hijacking depending on the attacker's ability to manipulate the heap.
Mitigation
The vulnerability is patched in Vim version 9.0.2068 [1][4]. The fix adds an overflow check in the get_list_range function, ensuring that parsed numbers exceeding INT_MAX cause the parsing to fail gracefully [4]. Users should upgrade to Vim 9.0.2068 or later. No workaround is available for unpatched versions; users are advised to avoid processing untrusted files with Vim until they can update.
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
28- osv-coords26 versionspkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.4pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%2015.5pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.3pkg:rpm/opensuse/vim&distro=openSUSE%20Leap%20Micro%205.4pkg: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%20Micro%205.5pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Basesystem%2015%20SP5pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP4pkg:rpm/suse/vim&distro=SUSE%20Linux%20Enterprise%20Module%20for%20Desktop%20Applications%2015%20SP5pkg: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%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%20SP3
< 9.0.2103-150000.5.57.1+ 25 more
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150500.20.6.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150500.20.6.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150500.20.6.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150500.20.6.1
- (no CPE)range: < 9.0.2103-17.26.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-17.26.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
- (no CPE)range: < 9.0.2103-150000.5.57.1
Patches
0No patches discovered yet.
Vulnerability mechanics
AI mechanics synthesis has not run for this CVE yet.
References
5- github.com/vim/vim/commit/9198c1f2b1ddecde22af918541e0de2a32f0f45amitrex_refsource_MISC
- github.com/vim/vim/security/advisories/GHSA-q22m-h7m2-9mgmmitrex_refsource_CONFIRM
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/DNMFS3IH74KEMMESOA3EOB6MZ56TWGFF/mitre
- lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/IVA7K73WHQH4KVFDJQ7ELIUD2WK5ZT5E/mitre
- security.netapp.com/advisory/ntap-20231208-0006/mitre
News mentions
0No linked articles in our index yet.