CVE-2026-52859
High · 8.2CVSS
8.2
EPSS
0.3%
Published
Jun 11, 2026
CISA due date
—
Cloudanix analysis
A flaw in Vim can let specially crafted terminal output crash the editor, so users should update to a fixed version.
- Exploitation
- Remote Unauthenticated
- Attacker needs
- None
- Complexity
- Low
- Impact
- Denial Of Service
- Component
- Application
- Class
- Memory Corruption
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
CVE-2026-52859 is an out-of-bounds read/write condition in Vim's terminal snapshot handling before version 9.2.0565. When Vim copies the visible contents of a :terminal buffer into scrollback, update_snapshot() iterates through each terminal cell's chars[] array until it finds a NUL terminator. A legitimate terminal cell containing the maximum six codepoints, such as a base character plus five combining marks, may not include a terminating NUL from libvterm. Vim then reads past the fixed-size array and appends extra values into a buffer sized for only six characters. The most likely technical result is a Vim process crash, although the bug is in memory handling and should be treated as a potential stability and memory-safety issue wherever untrusted terminal output can be rendered inside Vim.
Why it matters to the business
Successful exploitation can crash Vim sessions that render attacker-controlled terminal output, disrupting development, administration, incident response, and operational workflows that rely on Vim's embedded terminal. The practical risk is highest for users who run untrusted programs, connect to untrusted remote systems, or inspect hostile output inside Vim's :terminal feature. This issue is not currently listed in CISA KEV, is not known to be used in ransomware campaigns, has low EPSS, and has no reported mature exploit, so broad internet-scale exploitation appears unlikely; however, the affected product is widely deployed across developer and server environments, making patching important for resilience.
How an attack unfolds
An attacker needs a way to cause specially crafted terminal output to be displayed inside a vulnerable Vim :terminal window. This could occur when a user runs an attacker-supplied program, opens a terminal session to an untrusted system, executes a command that prints hostile Unicode/terminal output, or otherwise renders attacker-controlled bytes in Vim's terminal emulator. The crafted output creates a terminal cell filled with the maximum number of characters supported by libvterm, such as one base character followed by five combining marks. When Vim takes a terminal snapshot and copies visible screen cells into the scrollback buffer, update_snapshot() expects a NUL terminator that may not be present. Vim then walks past the end of the six-element array and writes out-of-bounds values into an undersized buffer, typically causing a segmentation fault or abnormal termination of the Vim process.
How to fix it
Upgrade Vim to version 9.2.0565 or later. If Vim is supplied by an operating system package manager, apply the vendor security update that backports the fix, even if the displayed upstream version appears older. Where immediate patching is not possible, reduce exposure by avoiding Vim's :terminal feature for untrusted commands or remote systems, not running attacker-provided programs inside Vim terminal buffers, and using a separate terminal emulator for untrusted output until patched. Rebuild any statically packaged or bundled Vim distributions so that the patched terminal.c logic is included.
How to confirm the fix worked
Confirm that Vim reports version 9.2.0565 or later, or that the operating system vendor package changelog explicitly includes the fix for this vulnerability. Run `vim --version` and compare against the patched version or vendor advisory. Inventory developer workstations, jump hosts, administration servers, containers, and automation images that include Vim. Validate package status using the relevant package manager, such as `dpkg -l vim`, `rpm -q vim`, `apk info vim`, `brew list --versions vim`, or equivalent. If regression testing is performed, verify that rendering terminal cells containing a base character plus multiple combining marks in a :terminal buffer no longer crashes Vim.
Typical attack path
- Identify a user or workflow that uses Vim's embedded :terminal feature.
- Deliver or host content, a script, command output, or remote terminal session that emits the crafted character sequence.
- Cause the victim to render the malicious output inside a vulnerable Vim terminal window.
- Trigger Vim's terminal snapshot logic, causing update_snapshot() to process the crafted terminal cell.
- Exploit the missing bounds check to read past the chars[] array and overrun the destination buffer.
- Cause Vim to crash, interrupting the user's editing or terminal session.
How to detect it
There are no reliable public indicators proving exploitation of this issue from logs alone, because exploitation is expected to appear primarily as a local Vim crash after rendering crafted terminal output. Review endpoint detection, EDR, system journal, crash reporter, and core dump records for Vim segmentation faults or abnormal terminations, especially where the user was using Vim's :terminal feature. Useful sources include Linux journald, syslog, auditd, apport, ABRT, systemd-coredump, macOS crash reports, shell history, terminal session recording, and EDR process telemetry. Look for crashes in or near terminal handling functions such as update_snapshot(), terminal.c, libvterm, or vterm screen handling. Correlate crashes with recently executed untrusted programs, suspicious scripts, unusual Unicode-heavy output, remote terminal sessions, or command output containing repeated combining marks. Absence of these artifacts does not prove non-exploitation, because a simple process crash may leave limited forensic evidence.
- Vim: Caught deadly signal SEGV
- Vim: Finished.
- vim.core
- core.vim
- systemd-coredump
- Process vim dumped core
- segfault at
- comm="vim"
- executable: /usr/bin/vim
- /var/lib/systemd/coredump/core.vim
- /var/crash/*vim*.crash
- update_snapshot
- src/terminal.c
- libvterm
- vterm_screen
- Vim 9.2.0564
- VIM - Vi IMproved 9.2
What your security team should do
- Patch Vim to 9.2.0565 or later across workstations, servers, containers, and golden images where Vim is installed.
- Prioritize systems used by administrators, developers, incident responders, and users who interact with untrusted remote hosts or run untrusted command-line tools inside Vim.
- If patching is delayed, communicate a temporary restriction against using Vim's :terminal feature with untrusted programs or remote systems.
- Monitor endpoint and crash telemetry for repeated Vim segmentation faults or abnormal exits after terminal activity.
- Update vulnerability management checks to recognize both upstream Vim 9.2.0565+ and vendor-backported fixed packages.
- Because this is not KEV-listed, not ransomware-associated, and has low EPSS, handle as a normal memory-safety patch unless local exposure to untrusted terminal output is high.
The record
Vim is an open source, command line text editor. Prior to version 9.2.0565, the update_snapshot() function in src/terminal.c copies the visible terminal screen into the scrollback buffer when a snapshot is taken. For each screen cell it walks the cell's chars[] array with no upper bound, stopping only when it encounters a NUL terminator. When a cell legitimately fills all VTERM_MAX_CHARS_PER_CELL (6) slots — a base character plus five combining marks — the bundled libvterm returns the array without a terminating NUL, so the loop reads past the fixed six-element array and appends the out-of-bounds values to a buffer reserved for only six characters. A program whose output is rendered inside a :terminal window can trigger this with a short byte sequence and no Vim scripting, leading to a crash. This issue has been patched in version 9.2.0565.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|
Related vulnerabilities
- CVE-2026-92824 A flaw was found in libmodulemd. CWE-125
- CVE-2026-114038 A flaw was found in device-mapper-multipath. CWE-125
- CVE-2026-112896 Pillow is a Python imaging library. CWE-125
- CVE-2026-112278 rdesktop through 1.9.0 contains a heap out-of-bounds read vulnerability in… CWE-125
- CVE-2026-112273 libtins through 4.6 contains a heap out-of-bounds read vulnerability in DNS::compose_name… CWE-125
- CVE-2026-112073 A vulnerability was identified in Tencent ncnn up to 44b02dabdcf97499281a4692ebd65bad73dc… CWE-125
- CVE-2026-112020 LodePNG through 20261006 contains a heap out-of-bounds read vulnerability in… CWE-125
- CVE-2026-88842 A flaw was found in BusyBox dpkg. CWE-125