MEDIUM 5.5

CVE-2026-55892: Vim Spell-File Stack Buffer Overflow DoS Vulnerability

Vim versions before 9.2.0662 contain a stack buffer overflow vulnerability in the spell-checking module. When a user loads a maliciously crafted spell file (.spl) and dumps the word list, the editor can crash. The vulnerability exists because the code that walks through spell-file data structures doesn't validate how deep it descends before writing to fixed-size memory buffers, allowing an attacker to trigger a crash by crafting a spell file with excessive nesting.

Source data · NVD / CISA · public domain

CVSS
3.1 · 5.5 MEDIUM · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
Weaknesses (CWE)
CWE-787
Affected products
1 configuration(s)
Published / Modified
2026-06-25 / 2026-06-26

NVD description (verbatim)

Vim is an open source, command line text editor. Prior to 9.2.0662, the dump_prefixes() function in src/spell.c walks a spell-file prefix trie iteratively with a depth counter while dumping the prefixes that apply to a word. The counter is bounded only by the trie structure itself; it is never checked against the size of the fixed MAXWLEN-element stack arrays it indexes (prefix[], arridx[], curi[]). A crafted .spl file, loaded when the user dumps the word list, can drive the descent arbitrarily deep, so the function writes past the end of those arrays. This is a stack out-of-bounds write that corrupts the call frame and crashes the editor. This vulnerability is fixed in 9.2.0662.

3 reference(s) · View on NVD →

SEC.co analysis · AI-assisted, reviewed against source

Technical summary

The dump_prefixes() function in src/spell.c processes a trie data structure used for spell-checking prefixes. The function uses a depth counter to track descent through the trie but never validates this counter against MAXWLEN, the size of three stack arrays (prefix[], arridx[], curi[]). A crafted .spl file can force unbounded recursion depth, causing an out-of-bounds write that corrupts the stack frame. The vulnerability is a CWE-787 (out-of-bounds write) triggered during spell-list dumping operations.

Business impact

For most users, this is a denial-of-service risk: a crafted spell file causes Vim to crash, disrupting work. Organizations using Vim for automated text processing, scripting, or CI/CD pipelines could face service interruption if an attacker introduces a malicious spell file into shared spell-check resources. The vulnerability requires user interaction (loading a specific file), so targeted attacks are most plausible in environments where spell files are shared or downloaded from untrusted sources.

Affected systems

Vim versions prior to 9.2.0662 are affected. The vulnerability is triggered when a user explicitly loads a crafted .spl spell file and runs a command to dump the word list (e.g., :spelldump). Systems running older Vim versions with spell-checking enabled are at risk if they process untrusted spell files.

Exploitability

Exploitability is straightforward but requires user interaction. An attacker must craft a malicious .spl file and either convince a user to load it or place it where it will be automatically loaded. The crash is deterministic and does not appear to enable code execution—it is limited to denial of service. No active exploitation in the wild has been documented, and the vulnerability does not appear on CISA's KEV list.

Remediation

Update Vim to version 9.2.0662 or later. Users unable to update immediately should avoid loading spell files from untrusted sources and consider disabling spell-checking if spell files are sourced externally. For automated or headless environments, review whether spell-checking is necessary and disable it if not in use.

Patch guidance

Vim maintainers have patched the vulnerability in version 9.2.0662 by adding bounds checking to the depth counter in dump_prefixes(). Verify the patch version against the official Vim release notes and apply it through your package manager (apt, brew, yum) or by rebuilding from source. If you maintain or distribute spell files, validate them after updating to ensure compatibility.

Detection guidance

Monitor for unexpected Vim crashes, particularly those correlating with spell-file loading or dumping operations. Log file analysis may show segmentation faults or abnormal termination. In development environments, watch for errors in spell-check initialization or custom spell-file sourcing. Intrusion detection systems can flag attempts to deliver .spl files through email or web downloads if your organization restricts such file types.

Why prioritize this

This vulnerability merits timely patching but is not critical. The CVSS 5.5 (Medium) rating reflects the requirement for user interaction and the denial-of-service impact (no code execution). Prioritize patching if your organization relies on Vim in automated workflows, CI/CD pipelines, or if users frequently receive spell files from external sources. Standard development and editing use cases are lower risk.

Risk score, explained

CVSS 3.1 score of 5.5 (Medium) reflects: local attack vector (AV:L) because the file must be on the user's system, low attack complexity (AC:L) since crafting the .spl file is straightforward, no privilege requirement (PR:N), user interaction required (UI:R) to load and dump the file, unchanged scope (S:U), and high availability impact (A:H) from the crash. The absence of confidentiality or integrity impact (C:N, I:N) and the interaction requirement keep the score moderate.

Frequently asked questions

Can this vulnerability be exploited remotely or does it require local access?

The vulnerability is local only. An attacker must place a malicious .spl file on the target system or convince a user to download and open it. There is no remote code execution and no network attack vector.

What Vim features or configurations are most at risk?

Users with spell-checking enabled and those who load custom or external spell files are most at risk. The vulnerability is triggered specifically when dump_prefixes() is called during spell-list dumping. Most standard interactive Vim usage does not trigger the vulnerable code path unless spell-checking is actively used.

Is there a workaround if I cannot update immediately?

Yes. Disable spell-checking (set nospell in your .vimrc), avoid loading spell files from untrusted sources, or restrict which .spl files are loaded in your environment. These mitigations reduce exposure until version 9.2.0662 or later is deployed.

Could this vulnerability be used for privilege escalation or code execution?

No. The vulnerability causes a stack corruption that crashes Vim but does not appear to provide a path to code execution or privilege escalation. The impact is denial of service only.

This analysis is provided for informational purposes and does not constitute professional security advice. The details are based on the CVE record as of the publication date. Verify all patch versions, affected product lists, and mitigation steps against official vendor advisories before deployment. Testing in non-production environments is strongly recommended. Exploitation status and threat intelligence may evolve; monitor official sources for updates. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).