Executive brief
Vim is a widely used open-source text editor. A vulnerability exists where opening a specially crafted undo or swap file can cause the application to read memory outside of its intended boundaries. This can lead to an immediate crash of the editor or the potential exposure of sensitive information stored in the computer's memory.
Technical details
An out-of-bounds read vulnerability (CWE-125) exists in Vim's handling of text properties stored in undo and swap files. Since patch 9.2.0320, text properties are stored inline; however, the application failed to validate that the 'tp_text_offset' and 'tp_len' for virtual-text properties remained within the bounds of the property data buffer. When Vim restores or displays a line from a malicious file, it converts the untrusted offset into a pointer without bounds checking. An attacker can exploit this by providing a crafted file that, when opened or recovered by a user, causes a heap-based out-of-bounds read. This can result in a denial of service (crash) or the disclosure of adjacent heap memory. The issue is resolved in version 9.2.0679.
Affected products
- Vim Vim >= 9.2.0320, < 9.2.0679
Timeline
- 2026-06-20: advisory: GitHub Security Advisory published
- 2026-06-20: patched: Fixed in Vim patch 9.2.0679
- 2026-06-25: disclosed: NVD publication date