CVE-2026-57455
Vim vulnerability analysis and mitigation

Overview

CVE-2026-57455 is a stack out-of-bounds write vulnerability in Vim's spell-checking subsystem, specifically in the spell_soundfold_sofo() function in src/spell.c. It affects all Vim versions prior to 9.2.0698 and was disclosed on June 21, 2026, by the Vim project via a GitHub Security Advisory. The vulnerability carries a CVSS v3.1 base score of 7.8 (High) and a CVSS v4.0 base score of 4.0 (Medium) (GitHub Advisory).

Technical details

The root cause is a missing bounds check (CWE-787: Out-of-bounds Write) in the single-byte branch of spell_soundfold_sofo(). The copy loop iterates over the input word and writes one byte per character into a fixed-size MAXWLEN-element (254 bytes) stack buffer (res[]), advancing the output index ri with no upper bound — terminating only on a NUL byte. The sibling multibyte branch correctly guards with if (ri + MB_MAXBYTES > MAXWLEN) break;, but the single-byte branch (active under 8-bit encodings such as latin1) lacks any equivalent guard. Any word longer than 253 bytes passed to soundfold() while a SOFO-based spell language is active will overflow the stack buffer, corrupt the call frame, and crash the editor. The fix in commit 497f931 adds && ri < MAXWLEN - 1 to the loop condition (GitHub Advisory, Patch Commit).

Impact

Successful exploitation causes a stack buffer overflow that corrupts the eval_soundfold() call frame and crashes the Vim editor, resulting in a denial of service. Under certain conditions, the high-severity CVSS v3.1 rating reflects potential for confidentiality, integrity, and availability impact, as stack corruption can theoretically be leveraged for code execution, though practical exploitation for code execution is constrained by the specific encoding and configuration requirements. The vulnerability is local in scope and requires user interaction, limiting its blast radius to the affected user's session (GitHub Advisory).

Exploitation steps

  1. Precondition Setup: Ensure Vim is configured with an 8-bit encoding such as latin1 (e.g., set encoding=latin1), as the vulnerable single-byte branch is not reached under the default UTF-8 encoding.
  2. Prepare a SOFO spell file: Create or obtain a spell language file that includes a SOFO (sound-folding) byte map (e.g., an .aff file with SOFOFROM and SOFOTO directives), and compile it into a .spl file using mkspell.
  3. Enable spell checking: Load the SOFO-based spell language in Vim (setl spelllang=<lang>.latin1.spl spell).
  4. Trigger the overflow: Invoke soundfold() on a string longer than 253 bytes (e.g., via a Vim script: let sound = soundfold(repeat('ab', 300))), or open a file containing such a word while sound-based spell suggestions are active.
  5. Result: The unbounded copy loop in spell_soundfold_sofo() writes past the end of the 254-byte stack buffer, corrupting the call frame and crashing the editor (GitHub Advisory, Patch Commit).

Indicators of compromise

  • Process: Vim process terminating unexpectedly with a segmentation fault or stack smashing error (e.g., *** stack smashing detected ***) when spell checking or soundfold() is invoked.
  • Logs: System logs (e.g., /var/log/syslog, journalctl) showing Vim crash reports or core dumps associated with spell_soundfold_sofo or eval_soundfold stack frames.
  • File System: Unexpected core dump files (e.g., core, vim.core) in the working directory or configured core dump location following Vim crashes during spell operations.

Mitigation and workarounds

Upgrade Vim to version 9.2.0698 or later, which adds the missing bounds check (ri < MAXWLEN - 1) to the single-byte SOFO branch of spell_soundfold_sofo() (Patch Commit, Release v9.2.0698). Ubuntu users can apply the fix via USN-8500-1. As a temporary workaround, avoid using 8-bit encodings such as latin1 (the default UTF-8 encoding takes the already-bounded multibyte branch), disable spell checking (set nospell), or avoid invoking soundfold() on untrusted or unbounded input until patching is complete (GitHub Advisory).

Community reactions

The vulnerability was reported and analyzed by Cipher / Causal Security (https://causalsecurity.com/), who also suggested the fix, and was acknowledged by the Vim project maintainer Christian Brabandt in the security advisory (GitHub Advisory). The issue was picked up by downstream distributors including Ubuntu (USN-8500-1) and tracked by Yocto Project security lists. No significant broader media coverage or social media discussion has been observed.

Additional resources


SourceThis report was generated using AI

Related Vim vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2026-59858HIGH8.4
  • Vim logoVim
  • vim-enhanced
NoYesJul 09, 2026
CVE-2026-59856HIGH8.4
  • Vim logoVim
  • vim
NoYesJul 09, 2026
CVE-2026-57456HIGH8.4
  • Vim logoVim
  • vim-common
NoYesJun 25, 2026
CVE-2026-59857MEDIUM5.6
  • Vim logoVim
  • xxd
NoYesJul 09, 2026
CVE-2026-57455MEDIUM4
  • Vim logoVim
  • vim-filesystem
NoYesJun 25, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management