Executive brief
Vim is a widely used open-source text editor. A vulnerability in how it handles spell-check files could allow an attacker to crash the application. This can be triggered automatically if a user opens a text file containing a malicious configuration line (modeline) while a specially crafted spell file is present on the system.
Technical details
A heap-based buffer overflow exists in the read_compound() function within src/spellfile.c. The vulnerability is caused by an integer overflow when calculating the buffer size for a regex pattern; specifically, an attacker-controlled 'sectionlen' field triggers a 32-bit signed integer multiplication wrap-around when UTF-8 encoding is active. This results in a small memory allocation (e.g., 27 bytes) followed by a loop that attempts to write approximately 1 billion bytes, leading to a heap overflow. An attacker can trigger this by planting a malicious .spl file in the runtime path and using a 'modeline' in a text file to set 'spelllang', forcing Vim to load the crafted file. The issue is fixed in version 9.2.0450 by using size_t for calculations and implementing a maximum length check (COMPOUND_MAX_LEN).
Affected products
- Vim Vim < 9.2.0450
Timeline
- 2026-05-07: advisory: GitHub Security Advisory published
- 2026-05-07: patched: Patch 9.2.0450 released
- 2026-05-08: disclosed: NVD publication date
- 2026-05-14: other: CVE ID confirmed on oss-security mailing list