CVE-2026-45130: Vim: Heap Buffer Overflow in spell file loading
Last updated 21 May 2026
Other sources
Vim is an open source, command line text editor. Prior to version 9.2.0450, a heap buffer overflow exists in readcompound() in src/spellfile.c when loading a crafted spell file (.spl) with UTF-8 encoding active. An attacker-controlled length field in the spell file's compound section overflows a 32-bit signed integer multiplication, causing a small buffer to be allocated for a write loop that runs many iterations, overflowing the heap. Because the 'spelllang' option can be set from a modeline, a text file modeline can trigger spell file loading if a malicious .spl file has been planted on the runtimepath. This issue has been patched in version 9.2.0450.
— MITRE
Vim: Heap Buffer Overflow in spell file loading
— Microsoft
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/vimto a version that resolves this vulnerability.Fixed in 2:9.2.0461-1Fixed in 2:9.2.0524-1 - Upgrade
Upgrade
Vimto a version that resolves this vulnerability.Fixed in 9.2.0450 - Configuration
Disable modelines or otherwise prevent the 'spelllang' option from being set via modelines so a text file cannot trigger loading a malicious .spl file from the runtimepath.
Vim spelllang (modeline-controlled) = Prevent modeline from setting spelllang (disable modelines or otherwise disable modeline support) - Compensating control
Ensure the runtimepath used by Vim does not include attacker-writable locations where a malicious .spl file could be planted for spell file loading.
Event History
Frequently Asked Questions
What is the severity of CVE-2026-45130?
CVE-2026-45130 is classified as a critical vulnerability due to the potential for remote code execution via the heap buffer overflow.
How do I fix CVE-2026-45130?
To fix CVE-2026-45130, upgrade Vim to version 9.2.0450 or later.
What versions of Vim are affected by CVE-2026-45130?
All versions of Vim prior to 9.2.0450 are affected by CVE-2026-45130.
What is the impact of CVE-2026-45130?
The impact of CVE-2026-45130 includes the potential execution of arbitrary code if a user loads a malicious spell file.
Can CVE-2026-45130 be exploited remotely?
Yes, CVE-2026-45130 can be exploited remotely if an attacker can persuade a user to load a crafted spell file.