GHSA-qm9w-fmpj-879h
CVE Information
Out-of-bounds Write in Spell File Prefix Dump in Vim < 9.2.0662
Date: 16.06.2026 Severity: Medium CVE: CVE-2026-55892 CWE: Out-of-bounds Write (CWE-787)
Summary
The
dump_prefixes()function insrc/spell.cwalks 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 fixedMAXWLEN-element stack arrays it indexes (prefix[],arridx[],curi[]). A crafted.splfile, 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.Description
dump_prefixes()is called fromspell_dump_compl()when the word list is dumped, for example on:spelldumpor via spelling completion. For each node it descends one level with:The arrays haveelse { prefix[depth++] = c; arridx[depth] = idxs[n]; curi[depth] = 1; }MAXWLEN(254) elements, so anydepthof 254 or more writes out of bounds; a second sink underflows asize_tlength passed tovim_strncpy()oncedepthreachesMAXWLEN. In a well-formed file each trie level corresponds to one byte of a prefix, so depth is naturally limited, but the reader does not enforce this for shared subtrees: aBY_INDEXshared reference is accepted (its target index is range-checked) and is not recursed into. A prefix trie that uses a shared reference to point back to an ancestor or itself therefore parses cleanly while driving the iterative walker pastMAXWLEN. This is the same class of issue as GHSA-wgh4-64f7-q3jq (tree_count_words(), fixed in 9.2.0653) in a sibling trie walker that was left unguarded.Impact
A spell file is normally inert data, but Vim resolves
spelllang,spellfile, andruntimepathto load it, so a repository or archive that ships a maliciousspell/sidecar can deliver the crafted file. The trigger is user-interaction-gated: spell checking must be enabled and the user must dump the word list. When that happens, the out-of-bounds write corrupts thedump_prefixes()stack frame.Acknowledgements
The Vim project would like to thank Cipher / Causal Security (https://causalsecurity.com/) for reporting and analyzing the issue and suggesting a fix.
References
The issue has been fixed as of Vim patch v9.2.0662. - Commit - Github Security Advisory