Vim Heap-Based Buffer Overflow and Out-of-Bounds Read Vulnerability in Terminal Emulator

Vulnerability

A heap-based buffer overflow vulnerability allowing write operations and an out-of-bounds read have been identified in Vim's terminal emulator. This issue affects Vim versions prior to 9.2.0076 and arises when the editor processes the maximum number of combining characters from Unicode supplementary planes. The vulnerability is located in the 'handle_pushline()' function within 'src/terminal.c'. The heap overflow occurs because Vim allocates 21 bytes per cell, based on the assumption that characters will remain within the Basic Multilingual Plane (BMP). However, a cell can actually contain up to six characters from supplementary planes, each requiring four bytes, leading to a three-byte heap overflow. The out-of-bounds read is caused by a loop that iterates over cell characters without properly checking the boundaries, allowing it to read past the end of the character array.

Impact

Exploitation of this vulnerability can lead to a heap-based buffer overflow, causing a crash or potential memory corruption. Such memory corruption could be leveraged for arbitrary code execution, according to a GitHub advisory.

Reproduction

The vulnerability can be reproduced by using a Vim version prior to 9.2.0076 and sending a terminal output that includes a high number of combining characters from Unicode supplementary planes. This can be done by using a command that outputs such characters into a Vim terminal buffer.

Remediation

Users can upgrade to Vim version 9.2.0076 or later to address this vulnerability.

Added: Feb 27, 2026, 10:19 PM
Updated: Feb 28, 2026, 1:18 AM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
7.5
exploitability
4.0
remediation
7.7
relevance
3.3
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.