CVE-2026-59856

Vim: Arbitrary Code Execution via PHP Omni-Completion

Published Jul 9, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

Vim's Omni-Completion feature for PHP fails to escape class or trait names that are read from the current buffer. A name containing a single quote can terminate the win_execute() argument early, letting attackers insert arbitrary Ex commands that are passed to :! and executed by the operating system. The resulting vulnerability allows an attacker who can open a crafted PHP file and invoke omni-completion to run arbitrary commands, compromising the confidentiality, integrity, and availability of the system running Vim.

Affected Systems

The issue affects Vim versions prior to 9.2.0736, specifically the vim:vim product. The insecure PHP Omni-Completion script is located in runtime/autoload/phpcomplete.vim. Users who run older Vim releases on any platform that supports this feature are susceptible.

Risk and Exploitability

The CVSS score is 8.4, indicating high severity. The EPSS score of < 1% indicates a very low probability of exploitation, and the vulnerability is not listed in CISA's KEV catalog. Because the flaw runs operating‑system commands with the user's privileges, exploitation can result in full remote command execution against the account running Vim. The attack requires a victim to edit a crafted PHP file and invoke omni-completion; based on the description, it is inferred that the likely attack vector is local or session‑based. The lack of published exploits does not diminish the risk; the flaw is straightforward to exploit once the conditions are met.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Vim to release 9.2.0736 or later, where the PHP omni‑completion script has been fixed to properly escape input and remove the win_execute() call.
  • If an upgrade is not immediately possible, disable the omni‑completion feature for PHP by setting the 'omnifunc' option to an empty string or removing the plugin from runtime paths, preventing the vulnerable code from being loaded.
  • As a temporary precaution, configure Vim to disallow the use of the :! command globally or within the session by setting the 'shell' option to a safe path or using the 'noshell' setting, limiting the ability to execute arbitrary OS commands.

Generated by OpenCVE AI on August 1, 2026 at 13:34 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8541-1 Vim vulnerabilities
History
Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.3, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:L/I:L/A:L'}

threat_severity

Moderate

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Vim
Vim vim
Vendors & Products Vim
Vim vim
Type Values Removed Values Added
Description 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.
Title Vim: Arbitrary Code Execution via PHP Omni-Completion
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 8.4, 'vector': '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'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jul 14, 2026, 3:55 AM
Reserved
Jul 7, 2026, 3:41 PM
Status
Analyzed
Published
Jul 9, 2026, 11:17 PM
Modified
Jul 14, 2026, 5:16 AM
Severity
Moderate
Public date
Jul 9, 2026, 10:39 PM