Skip to main content

Vim CVE-2026-45130

MEDIUM
Heap-based Buffer Overflow (CWE-122)
2026-05-08 GitHub_M
5.5
CVSS 3.1 · NVD
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Recon
    Gain write access to Vim runtimepath directory
  2. Delivery
    Plant crafted .spl with oversized COMPOUND length
  3. Exploit
    Deliver text file with spelllang modeline
  4. Install
    Victim opens file in vulnerable Vim
  5. C2
    Modeline triggers spell file load
  6. Execute
    Integer overflow allocates undersized heap buffer
  7. Impact
    Write loop overflows heap
  8. Step 8
    Process crash or code execution

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V15 - Secure Coding and Architecture Heap buffer bounds checking
MITRE ATT&CK

1 technique across 1 tactic: Execution

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Two simultaneous preconditions are required. First, a malicious .spl file must already be present in a directory on Vim's runtimepath (e.g., ~/.vim/spell/ or a path listed in &runtimepath) - the attacker must have pre-planted this file through write access, a shared filesystem, or social engineering. Second, the victim must open a file in Vim that contains a modeline setting spelllang to trigger loading of the planted .spl, with UTF-8 encoding active and Vim's modeline feature not disabled. No system authentication or elevated privileges are required of the attacker (PR:N). Exploitation is bounded by: the necessity of pre-planting the .spl on the runtimepath (requires attacker write access to that path or user cooperation), the requirement for active user interaction (opening the text file in Vim), the absence of any network delivery path (AV:L), and the fact that SSVC rates this as not automatable - consistent with a multi-step, per-victim attack that cannot be mass-deployed without runtimepath access.

Impact

The CVSS 3.1 score of 6.6 (Medium) is grounded in AV:L (local file-based delivery), UI:R (victim must open a file), C:L/I:L (partial memory disclosure and write capability), and A:H (heap corruption can crash or destabilize the process). The vendor-assigned PR:N is accurate in that the attacker does not need system credentials, but it somewhat understates the setup burden: a malicious .spl file must be pre-positioned on the Vim runtimepath before the modeline triggers loading. EPSS at 0.00% (0th percentile) and SSVC's 'exploitation: none, automatable: no, technical impact: partial' collectively indicate no observed opportunistic or automated exploitation. However, a public PoC exists (GitHub Gist by zhuozhenwei, confirmed in references), which elevates near-term risk - particularly for users who open files from untrusted sources in shared or version-controlled environments where runtimepath directories may be attacker-writable. The gap between the public PoC and the 0.00% EPSS is consistent with a proof-of-concept that has not yet been operationalized in mass campaigns. Overall this is a real but conditional threat: prioritize patching for environments with shared Vim runtimepaths, CI pipelines that open arbitrary files, or users who regularly process untrusted documents.

Exploit ScenarioDerived

An attacker with write access to a shared Vim runtimepath directory (e.g., a team's shared ~/.vim/ checkout or a CI workspace) plants a crafted .spl file containing an oversized COMPOUND section length field. The attacker then delivers a text file embedding a Vim modeline such as `

vim: set spelllang=xx:` referencing the malicious spell file; when a developer opens this file in a Vim version prior to 9.2.0450 with default modeline settings and UTF-8 encoding active, read_compound() triggers, the integer multiplication overflows, and the heap write loop corrupts adjacent allocations - potentially crashing Vim or enabling controlled code execution. A public PoC demonstrating this is available at https://gist.github.com/zhuozhenwei/9e579b64c83fd2d254e25f1629da2796.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Jul 24, 2026

Heap buffer overflow in Vim's spell file parser affects all versions prior to 9.2.0450, reachable via a crafted .spl file that exploits a 32-bit signed integer multiplication overflow in read_compound() to allocate an undersized heap buffer and overflow it during a write loop. The attack can be delivered passively through Vim's modeline feature: a text file with a spelllang modeline silently triggers .spl loading when a malicious spell file has been pre-planted on the runtimepath, requiring only that the victim open the file. A public proof-of-concept exists on GitHub Gist; EPSS is 0.00% and CISA KEV has not listed this CVE, indicating no confirmed widespread exploitation at time of analysis.

RemediationAI

Upgrade Vim to version 9.2.0450 or later; the patched release is available at https://github.com/vim/vim/releases/tag/v9.2.0450 and the fixing commit is 92993329178cb1f72d700fff45ca86e1c2d369f8. Ubuntu users should apply the update referenced in USN-8304-1 (https://ubuntu.com/security/notices/USN-8304-1) via their package manager. If immediate patching is not possible, add set nomodeline to the system or user vimrc (/etc/vim/vimrc or ~/.vimrc) to prevent modeline-triggered spell file loading; the trade-off is loss of legitimate per-file editor configuration embedded in modelines. As a complementary control, restrict write access to Vim runtimepath spell directories (typically ~/.vim/spell/ and /usr/share/vim/vimXX/spell/) to prevent attacker-controlled .spl file planting - this eliminates the automated delivery path but does not block a user who is socially engineered into manually loading a crafted spell file.

Affects your stack

Find out whether the stacks and servers you run are on an affected version.

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The vulnerable component is read_compound() in src/spellfile.c, which parses the COMPOUND section of Vim's binary .spl (spell language) files. The root cause (CWE-122, Heap-based Buffer Overflow) is a 32-bit signed integer multiplication overflow: the attacker-controlled todo field from the spell file's section header is multiplied as a signed 32-bit integer when computing heap allocation sizes (e.g., c = todo * 2 + 7). A sufficiently large todo value wraps the product to a small positive number, causing alloc() to return a tiny buffer while the subsequent write loop iterates todo times - far beyond the buffer's bounds. The fix in commit 92993329 introduces a COMPOUND_MAX_LEN constant (100,000), promotes all size calculations to size_t to eliminate overflow, and validates the length before allocation. The attack surface is widened by Vim's modeline mechanism: with modeline enabled (the default in most distributions), a file's embedded set spelllang=XX directive can auto-load a .spl file from the runtimepath without further user interaction. CPE: cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:* (all versions prior to 9.2.0450).

Know when Vim gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

NVD PRIMARY 5.5 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:N/I:N/A:H
vuln.today AI 5.8 MEDIUM

Pre-planting the malicious .spl on the victim's runtimepath is a measurable attack prerequisite beyond initial access, warranting AC:H over the vendor's AC:L.

3.1 AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:H
4.0 AV:L/AC:H/AT:N/PR:N/UI:A/VC:L/VI:L/VA:H/SC:N/SI:N/SA:N
SUSE 6.6 MEDIUM
AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:H
Red Hat 6.6 MEDIUM

Primary rating from NVD.

CVSS VectorNVD

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

Lifecycle Timeline

2
CVSS changed
Jul 24, 2026 - 20:22 NVD
6.6 (MEDIUM) 5.5 (MEDIUM)
CVE Published
May 08, 2026 - 22:42 nvd
MEDIUM 6.6

DescriptionNVD

Vim is an open source, command line text editor. Prior to version 9.2.0450, a heap buffer overflow exists in read_compound() in src/spellfile.c when loading a crafted spell file (.spl) with UTF-8 encoding active. An attacker-controlled length field in the spell file's compound section overflows a 32-bit signed integer multiplication, causing a small buffer to be allocated for a write loop that runs many iterations, overflowing the heap. Because the 'spelllang' option can be set from a modeline, a text file modeline can trigger spell file loading if a malicious .spl file has been planted on the runtimepath. This issue has been patched in version 9.2.0450.

Threat Intelligence Overview

EPSS Score
0.0%
Top 100% exploitable
Prevalence
High
default text editor shipped in most Linux/Unix distributions
Exploit
POC
Public exploit code exists
Social Media
1
Sightings
Data Quality
7 sources
Confidence: High
NVD CVE.org EPSS Vulnrichment MSRC Vendor CIRCL GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC Yes
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact· derived
High
Technical Impact
Partial

Priority Score

48
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

A buffer overflow occurs when a program writes more data to a memory buffer than it was allocated to hold, causing the excess data to spill into adjacent memory regions.

A heap overflow occurs when a program writes data beyond the bounds of a buffer allocated in the heap memory region.

Affected Products (CPE)NVD

cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*

More in Vim

View all
CVE-2022-3520 CRITICAL POC
9.8 Dec 02

Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0765. Rated critical severity (CVSS 9.8), this vuln

CVE-2022-0729 HIGH POC
8.8 Feb 23

Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2.4440. Rated high severity (CVSS 8.8), this

CVE-2026-34714 HIGH POC
8.6 Mar 30

Code execution vulnerability in Vim before 9.2.0272 allows attackers to gain immediate arbitrary command execution upon

CVE-2019-12735 HIGH POC
8.6 Jun 05

getchar.c in Vim before 8.1.1365 and Neovim before 0.3.6 allows remote attackers to execute arbitrary OS commands via th

CVE-2021-3968 HIGH POC
8.0 Nov 19

vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 8.0), this vulnerability is remotely exploita

CVE-2022-1616 HIGH POC
7.8 May 07

Use after free in append_command in GitHub repository vim/vim prior to 8.2.4895. Rated high severity (CVSS 7.8), this vu

CVE-2022-1619 HIGH POC
7.8 May 08

Heap-based Buffer Overflow in function cmdline_erase_chars in GitHub repository vim/vim prior to 8.2.4899. Rated high se

CVE-2021-4136 HIGH POC
7.8 Dec 19

vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication

CVE-2021-3973 HIGH POC
7.8 Nov 19

vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication

CVE-2021-3927 HIGH POC
7.8 Nov 05

vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication

CVE-2022-2125 HIGH POC
7.8 Jun 19

Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Rated high severity (CVSS 7.8), this vulnerability

CVE-2022-2126 HIGH POC
7.8 Jun 19

Out-of-bounds Read in GitHub repository vim/vim prior to 8.2. Rated high severity (CVSS 7.8), this vulnerability is no a

Vendor StatusVendor

SUSE

Severity: Medium
Product Status
SLES15-SP5-CHOST-BYOS-SAP-CCloud Fixed
SLES15-SP6-CHOST-BYOS Fixed
SLES15-SP6-CHOST-BYOS-Aliyun Fixed
SLES15-SP6-CHOST-BYOS-Azure Fixed
SLES15-SP6-CHOST-BYOS-EC2 Fixed

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy