Skip to main content

Vim CVE-2026-59856

HIGH
Code Injection (CWE-94)
2026-07-09 GitHub_M
8.4
CVSS 4.0 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Access
    Deliver crafted PHP file to victim
  2. Delivery
    Victim opens file in vulnerable Vim
  3. Exploit
    Victim invokes PHP omni-completion
  4. Execution
    Malicious name escapes search() pattern
  5. Persist
    Injected Ex :! command runs
  6. Impact
    Arbitrary OS commands execute as victim

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Code injection prevention, sandbox exec
MITRE ATT&CK

2 techniques across 2 tactics: Execution, Initial Access

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

Exploitation Conditions

Exploitation requires that the victim (1) is running Vim before 9.2.0736 with the bundled PHP omni-completion script phpcomplete.vim present, (2) opens an attacker-controlled PHP file whose class or trait name contains a single quote plus injected Ex text (e.g. |:!command), and (3) actively invokes PHP omni-completion on that buffer - this active user interaction (UI:A) is the primary limiting factor. It is a local vector (AV:L): the malicious content must be loaded into the editor. Limiting factors: it only triggers for the PHP filetype via its omni-completion path, requires the user to manually request completion (it does not fire on mere file open), and is fully neutralized once upgraded to 9.2.0736 or once PHP omnifunc is disabled. No authentication is required (PR:N), but the mandatory manual completion step meaningfully constrains real-world exploitation.

Impact

The vendor-supplied CVSS 4.0 vector (AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H, score 8.4) reflects local attack surface with high confidentiality, integrity, and availability impact but mandatory active user interaction - the victim must both open the malicious PHP file and manually trigger omni-completion. This is not a remote, no-interaction worm-class flaw; it is a client-side social-engineering vector, more comparable to opening a booby-trapped document than to a network-facing RCE. No EPSS score, POC, or KEV status was provided, so no evidence of active or automated exploitation exists at this time; exploitation is plausible but requires targeting users who edit untrusted PHP files with omni-completion. The signals are internally consistent: local vector plus required interaction correctly tempers the otherwise-high impact. Real priority is moderate - high impact but gated behind user action and a non-trivial workflow (PHP editing with omni-complete), so it warrants prompt patching for developer workstations that handle untrusted PHP but is not an emergency for the general population.

Exploit ScenarioDerived

An attacker crafts a PHP file in which a class or trait name embeds a single quote followed by a bar and an Ex command such as :!, then delivers it to a developer via a repository, email attachment, or shared project. The developer opens the file in a pre-9.2.0736 Vim and triggers PHP omni-completion, at which point the malicious name breaks out of the search() pattern and the injected :! command executes arbitrary shell commands under the victim's account. No public exploit is identified at time of analysis, and success depends on the local, interaction-required conditions in the CVSS 4.0 vector.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

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

Alert me

AnalysisAIv1 – Jul 09, 2026

Arbitrary OS command execution in Vim prior to 9.2.0736 arises from the bundled PHP omni-completion script (runtime/autoload/phpcomplete.vim), which interpolates an attacker-controlled class or trait name from the edited buffer into a search() pattern executed via win_execute() without escaping. When a victim opens a crafted PHP file and invokes omni-completion, a name containing a single quote breaks out of the search string and the trailing text is honored as Ex commands, letting an attacker run shell commands through :! . There is no public exploit identified at time of analysis and it is not listed in CISA KEV, but the flaw is fixed and the mechanism is well documented in the vendor advisory.

RemediationAI

Apply the vendor-released patch: upgrade Vim to version 9.2.0736 or later, which fixes the unescaped interpolation in phpcomplete.vim (fix commit 43afc581a37a35762dd0ef292f038b9dc5680a24; advisory https://github.com/vim/vim/security/advisories/GHSA-fh26-8f79-wj97). Where immediate upgrade is not possible, the practical compensating controls are to avoid invoking omni-completion (do not press the completion trigger such as CTRL-X CTRL-O) while editing PHP files from untrusted sources, or to disable/replace the PHP omni-completion by unsetting omnifunc for the php filetype (e.g. an autocmd that clears omnifunc, or removing/neutralizing runtime/autoload/phpcomplete.vim); the trade-off is loss of PHP class/trait completion. Most conservatively, do not open untrusted PHP files in a vulnerable Vim at all until patched, since the payload rides in ordinary buffer content.

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 Vim's built-in filetype completion framework - specifically the PHP omni-completion autoload script phpcomplete.vim, which parses buffer contents to discover PHP class and trait names for intelligent completion. The affected product per CPE is cpe:2.3:a:vim:vim (all versions before 9.2.0736). The root cause maps to CWE-94 (Improper Control of Generation of Code / code injection): the script builds a search() regex dynamically by concatenating a raw identifier taken from the edited file, then hands the resulting string to win_execute(). Because Vim treats the vertical bar (|) as an Ex command separator and single quotes as string delimiters, an unescaped identifier can prematurely terminate the search() argument and inject additional Ex commands, including :! which spawns an operating-system shell. This is a classic script-side injection where untrusted document content is promoted into an execution context.

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

Vendor (GitHub_M) PRIMARY 8.4 HIGH
CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N
vuln.today AI 7.8 HIGH

Local because malicious content must be loaded and completion manually invoked (AV:L, UI:R); no auth needed (PR:N); injected shell commands yield full C/I/A impact.

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

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Local
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
Active
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
High
Vulnerable system: Availability
High
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

DescriptionCVE.org

Vim is an open source, command line text editor. Prior to 9.2.0736, the PHP omni-completion script in runtime/autoload/phpcomplete.vim interpolates a class or trait name, taken from the contents of the edited buffer, into a search() pattern that is run via win_execute() without escaping. A name containing a single quote can terminate the search() string argument early, and because the bar is honored as an Ex command separator, the remainder of the name is run as Ex commands; via the :! command this allows arbitrary operating-system command execution when a victim opens a crafted PHP file and invokes omni-completion. This issue is fixed in version 9.2.0736.

Executive ViewAI

Why It Matters

Vim versions prior to 9.2.0736 contain an arbitrary command execution vulnerability in the bundled PHP omni-completion feature that permits attackers to execute system commands on developer and analyst workstations when a malicious PHP file is opened and code completion is invoked. This affects all technical staff using Vim for PHP development and poses a direct endpoint compromise risk.

Business Impact: High
Compensating Controls

Apply vendor patch: upgrade to Vim 9.2.0736 or later. Interim mitigation: disable PHP omni-completion feature in Vim configuration to prevent execution of crafted completion requests.

Threat Intelligence Overview

EPSS Score
0.5%
Top 62% exploitable
Prevalence
Ubiquitous
Vim ships by default on virtually all Unix/Linux systems and developer workstations
Social Media
1
Sightings
Data Quality
6 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 HIGH
CISA KEV No
Public POC No
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.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
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

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

Attack Technique

Code Injection CRITICAL

Code injection occurs when an application accepts user input and passes it directly into a language interpreter or evaluator without proper sanitization.

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

Affected Products (CPE)CVE.org

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: Important
Product Status
Container suse/sl-micro/6.0/baremetal-os-container:2.1.3-6.208 Container suse/sl-micro/6.1/baremetal-os-container:2.2.1-7.138 Affected
Container suse/sl-micro/6.0/toolbox:13.2-9.136 Affected
Container suse/sles/16.0/toolbox:latest Affected
SUSE Linux Enterprise Server 12 SP5-LTSS Fixed
SUSE Linux Enterprise Server LTSS Extended Security 12 SP5 Fixed

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