CVE-2026-28420
Vim vulnerability analysis and mitigation

Overview

CVE-2026-28420 is a heap-based buffer overflow (write) and out-of-bounds read vulnerability in Vim's terminal emulator (:terminal) affecting all versions prior to 9.2.0076. The flaws exist in the handle_pushline() function in src/terminal.c when processing terminal cells containing maximum combining characters from Unicode supplementary planes. It was disclosed on February 27, 2026, by GitHub users ehdgks0627 and un3xploitable, with the fix released the same day as Vim v9.2.0076. The vulnerability carries a CVSS v3.1 base score of 4.4 (Medium) (GitHub Advisory, Openwall OSS-Sec).

Technical details

The root cause involves two related flaws classified as CWE-122 (Heap-based Buffer Overflow) and CWE-125 (Out-of-bounds Read) in handle_pushline() within src/terminal.c. For the heap overflow: Vim allocates only 21 bytes (MB_MAXBYTES) per terminal cell via ga_grow(), assuming characters are within the Basic Multilingual Plane (BMP, max 3 bytes each). However, a cell can hold up to 6 characters from Unicode supplementary planes (4 bytes each), requiring 24 bytes — causing a 3-byte heap overflow during UTF-8 conversion. For the OOB read: the loop iterating over cell characters lacks a boundary check on the vterm_screen_cell_t.chars array; when a cell is fully populated, the loop reads index 6 of a 6-element (0–5) array. The fix changes the allocation to VTERM_MAX_CHARS_PER_CELL * 4 and adds an explicit loop boundary check (GitHub Advisory, Vim Commit).

Impact

Successful exploitation can cause Vim to crash (Denial of Service) or result in heap memory corruption, with low integrity and low availability impact and no confidentiality impact. An attacker who controls the output of a program running inside a Vim :terminal buffer — for example, a malicious script or binary executed within the terminal — can trigger the overflow. While the CVSS score reflects limited scope, heap corruption in theory could be leveraged for further memory exploitation depending on the runtime environment (GitHub Advisory, Openwall OSS-Sec).

Exploitation steps

  1. Identify a target: Locate a system running Vim versions prior to 9.2.0076 with the :terminal feature enabled (compiled with +terminal).
  2. Prepare malicious output: Craft a program or script that outputs terminal content containing cells with the maximum number of combining characters from Unicode supplementary planes (e.g., characters requiring 4-byte UTF-8 encoding such as U+10000 and above, combined up to 6 per cell).
  3. Trigger the terminal buffer: Convince the target user to open a Vim :terminal buffer and execute the malicious program within it (e.g., cat malicious_file.txt or running a crafted binary).
  4. Trigger the overflow: When Vim's handle_pushline() processes the terminal output, the insufficient buffer allocation (MB_MAXBYTES = 21 bytes instead of the required 24 bytes) causes a 3-byte heap overflow write, and the missing boundary check causes an out-of-bounds read on the vterm_screen_cell_t.chars array.
  5. Achieve impact: Depending on heap layout and memory protections, the result is a crash (DoS) or potential memory corruption that could be further leveraged (GitHub Advisory, Vim Commit).

Indicators of compromise

  • Process: Vim process crashing unexpectedly or producing segmentation faults when using the :terminal feature with Unicode-heavy output.
  • Logs: Core dump files (core, vim.core) generated by the Vim process; system logs (e.g., /var/log/syslog, journalctl) showing segfault entries for the vim binary.
  • File System: Presence of crafted text files containing dense Unicode supplementary plane combining characters (4-byte UTF-8 sequences) intended to be cat-ed or displayed inside a Vim terminal buffer.
  • Network: No network-based IOCs expected given the local attack vector.

Mitigation and workarounds

The primary remediation is to upgrade Vim to version 9.2.0076 or later, which fixes both the heap overflow and the OOB read in handle_pushline() (Vim Release). Linux distribution packages have been updated across Fedora, Ubuntu (USN-8101-1), Mageia (MGASA-2026-0049), Amazon Linux 2023 (ALAS2023-2026-1584), and Microsoft's CBL-Mariner/Azure Linux. As a workaround where patching is not immediately possible, avoid using Vim's :terminal feature with untrusted programs or files containing Unicode supplementary plane characters. Prioritize patching on shared development systems and environments where users routinely run external programs inside Vim terminal buffers (GitHub Advisory, Red Hat CVE).

Community reactions

The vulnerability was disclosed responsibly by GitHub users ehdgks0627 and un3xploitable directly to the Vim project, and Christian Brabandt (Vim maintainer) published the advisory and fix simultaneously on February 27, 2026, via the oss-security mailing list and GitHub Security Advisories. The moderate CVSS score and requirement for user interaction have kept community reaction measured, with coverage primarily limited to Linux distribution security advisories and vulnerability tracking platforms. No significant social media controversy or high-profile researcher commentary has been observed (Openwall OSS-Sec, GitHub Advisory).

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