CVE-2026-57451: Vim Text Editor Buffer Over-Read Vulnerability in Undo Files
Vim, the popular command-line text editor, contains a buffer over-read vulnerability in how it processes text properties stored within files. When Vim opens a specially crafted undo file, it may read far beyond the intended data boundaries, causing the application to crash. The vulnerability exists because Vim trusts a count value in the file without validating it against the actual data present. An attacker would need to convince a user to open a malicious undo file, but no special privileges or complex setup are required.
Source data · NVD / CISA · public domain
- CVSS
- 3.1 · 5.3 MEDIUM · CVSS:3.1/AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:N/A:H
- Weaknesses (CWE)
- CWE-125
- Affected products
- 1 configuration(s)
- Published / Modified
- 2026-06-25 / 2026-06-26
NVD description (verbatim)
Vim is an open source, command line text editor. Prior to 9.2.0670, get_text_props() in src/textprop.c reads a uint16 property count stored inline after a line's text and returns it as the number of 32-byte textprop_T entries that follow. The only check is a floor that guarantees room for a single entry; the count is never checked against the amount of data actually present. A line that declares a large count while carrying little data causes consumers to read far past the end of the line buffer. Such a line can be delivered through a crafted undo file, leading to a crash. This vulnerability is fixed in 9.2.0670.
3 reference(s) · View on NVD →
SEC.co analysis · AI-assisted, reviewed against source
Technical summary
The vulnerability resides in the get_text_props() function in src/textprop.c. This function reads a uint16 property count that is embedded inline after a line's text data and interprets it as the number of consecutive 32-byte textprop_T structures. The code performs only a floor check to ensure room for a single entry but does not validate the count against the actual buffer length. A line declaring a large count while containing insufficient data will cause out-of-bounds reads into adjacent memory. The flaw can be triggered via a crafted undo file (.un files), leading to information disclosure or crash. The issue was patched in version 9.2.0670.
Business impact
This vulnerability primarily affects availability. While the direct impact is a crash (denial of service), the out-of-bounds read could theoretically leak sensitive data from memory before the crash occurs. For organizations relying on Vim for critical editing workflows, unexpected crashes disrupt productivity. The attack surface is limited to users who open untrusted undo files, but the barrier to exploitation is low since undo files are binary artifacts that may be shared or cached without obvious risk signals.
Affected systems
Vim versions prior to 9.2.0670 are affected. The vulnerability affects all platforms where Vim runs (Linux, macOS, Windows, and others). Users who rely on undo file functionality are at highest risk, particularly those working in environments where undo files from external sources are encountered or synchronized across systems.
Exploitability
Exploitation requires user interaction: an affected user must open or process a malicious undo file. The CVSS vector reflects local access (AV:L), high complexity (AC:H), no privilege requirement, and user interaction. The technical barrier is low—crafting a malicious undo file requires only knowledge of the binary format and the property count field. However, social engineering is necessary; this is not a network-exploitable flaw. The vulnerability does not appear on the KEV catalog, suggesting no active exploitation in the wild at publication time.
Remediation
Update Vim to version 9.2.0670 or later. Users unable to update immediately should avoid opening undo files from untrusted sources. Undo files are typically stored in .vim/undo/ or similar locations; if possible, disable undo file persistence (set noundofile in your configuration) in high-risk environments until patching is completed. Organizations managing Vim deployments should prioritize patching in development and content-creation roles where undo functionality is heavily used.
Patch guidance
Verify that you are running Vim 9.2.0670 or later by executing :version in the editor. Binary distributions and package managers (apt, brew, rpm, etc.) should have updates available shortly after the official release. Compile from source if pre-built packages are not yet available; the fix is limited to textprop.c. Testing the patch by attempting to open a benign undo file will confirm the update took effect. No configuration changes are required post-patch.
Detection guidance
Monitor for Vim crashes in logs, particularly those coinciding with undo file access. End-user reports of unexpected editor crashes should be investigated for potential malicious undo file delivery. Network monitoring is less relevant since the attack is file-based, but watch for unusual .un file distribution through file sharing, email, or repositories. Endpoint detection could flag repeated Vim crashes or abnormal memory access patterns. Prior to patching, audit systems for suspicious .vim/undo/ directories, especially those containing recently modified or unexpectedly large files.
Why prioritize this
This vulnerability merits prompt but not emergency patching. The MEDIUM severity (5.3 CVSS) reflects the user-interaction requirement and local-only attack vector, which significantly reduces real-world risk compared to network-exploitable flaws. However, the crash impact (availability) and the low barrier to exploitation if a malicious undo file circulates warrant inclusion in the next patch cycle. Organizations should prioritize this for developers, system administrators, and power users who frequently interact with undo files, while routine user instances can follow standard update schedules.
Risk score, explained
The CVSS 5.3 MEDIUM score balances several factors: the vulnerability requires local file access and user action (reducing likelihood), but causes high availability impact (crash). The low attack complexity reflects the straightforward nature of crafting a malicious file, not the difficulty of delivering it. No confidentiality impact is expected in typical scenarios, though the out-of-bounds read theoretically could leak data. The lack of KEV listing and apparent absence of in-the-wild exploitation suggest this remains a low-noise risk, suitable for standard remediation timelines rather than emergency response.
Frequently asked questions
Can this vulnerability be exploited remotely?
No. The flaw requires opening a malicious undo file on the local system. While undo files could theoretically be delivered via email or file-sharing services, the attack is fundamentally local and requires user interaction to open the file in Vim.
Will updating Vim cause any data loss or configuration changes?
No. Updating to 9.2.0670 or later is a straightforward patch that does not alter configuration, undo history, or any user data. Existing undo files will continue to function normally if they are legitimate; only maliciously crafted files pose a risk.
How can I check if a .un undo file is malicious?
Undo files are binary and not easily inspected visually. The safest approach is to avoid opening undo files from untrusted sources. If you suspect a file is malicious, do not open it in Vim; instead, delete it or quarantine it for analysis by your security team.
What happens if Vim crashes due to this vulnerability?
The crash causes Vim to terminate, potentially losing unsaved work. The out-of-bounds read itself may not cause immediate harm beyond the crash, but there is a theoretical risk that sensitive data in adjacent memory could be leaked before the crash occurs.
This analysis is based on publicly disclosed vulnerability data current as of the publication date. Patch version numbers and affected product versions are sourced from official vendor advisories and should be verified against vendor documentation before deployment. Exploitation scenarios described are illustrative and based on technical analysis; actual attack complexity and prevalence may vary. Organizations should conduct their own risk assessment based on their specific Vim usage, network policies, and threat landscape. This document does not constitute a guarantee of security and should be used in conjunction with vendor guidance and internal security processes. Source: NVD (public-domain), retrieved 2026-08-03. Analysis generated by SEC.co (claude-haiku-4-5).
Related vulnerabilities
- CVE-2026-57452MEDIUMVim Encrypted File Underflow Denial of Service
- CVE-2026-57454MEDIUMVim Out-of-Bounds Read in Undo/Swap File Handling
- CVE-2026-52859HIGHVim Terminal Buffer Overflow Vulnerability - Crash via Malicious Output
- CVE-2020-9711MEDIUMAdobe Acrobat Reader Out-of-Bounds Read Memory Disclosure
- CVE-2020-9713MEDIUMAdobe Acrobat Reader Memory Disclosure Vulnerability
- CVE-2025-15661MEDIUMlibssh2 Out-of-Bounds Heap Read in SFTP Symlink Handling
- CVE-2025-70101MEDIUMlwext4 1.0.0 Out-of-Bounds Read Denial of Service
- CVE-2026-0127MEDIUMAndroid Out-of-Bounds Read in Communication Processor – Impact & Patch Guidance