CVE-2026-47167

Vim: Vimscript Code Injection in cucumber filetype plugin via crafted step-definition regex

Published Jun 11, 2026 CVSS 4.0 · 5.1 Medium EPSS < 1% KEV · Not listed
Description
Vim is an open source, command line text editor. Prior to version 9.2.0496, a code injection vulnerability exists in s:stepmatch() in the cucumber filetype plugin (runtime/ftplugin/cucumber.vim) on Vim builds with +ruby support. Step-definition patterns read from .rb files under the repository's features/*/ or stories/*/ directories are embedded into a Ruby Kernel.eval argument without sufficient escaping, allowing a crafted pattern in an attacker-controlled repository to execute arbitrary Ruby (and through it arbitrary shell commands) when the user invokes a step-jump mapping ([d, ]d). This issue has been patched in version 9.2.0496.

Analysis

AI-generated

Technical impact

The vulnerability exists in Vim's cucumber filetype plugin. Step‑definition patterns read from .rb files in features/* or stories/* directories are inserted into a Ruby Kernel.eval call without proper escaping. This allows an attacker who controls a repository to craft a regex that contains arbitrary Ruby code, which will be executed whenever the user triggers the step‑jump mapping. The weakness is a classic code injection (CWE‑94) coupled with unsafe evaluation of user input (CWE‑95).

Affected Systems

Affected products include Vim (open‑source command‑line editor) running with +ruby support before version 9.2.0496. The patch is in release 9.2.0496, and any earlier Vim builds that load runtime/ftplugin/cucumber.vim on an attacker‑controlled repository are vulnerable. All platforms that compile Vim with Ruby support are potentially impacted.

Risk and Exploitability

The CVSS score of 5.1 indicates moderate severity. The EPSS score is unavailable, and the vulnerability is not listed in the CISA KEV catalog. Exploitation requires a local user to open a malicious repository and invoke the step‑jump mapping; thus the attack vector is local and depends on the presence of +ruby support. While unlikely to be delivered remotely, a compromised user could gain full control of the local system through arbitrary shell commands executed by the injected Ruby code.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Vim to version 9.2.0496 or later, which removes the unsafe eval from the cucumber plugin.
  • If upgrading is not immediately possible, rebuild Vim without +ruby support or disable the cucumber filetype plugin by removing or commenting out runtime/ftplugin/cucumber.vim.
  • Avoid opening untrusted repositories that contain step‑definition .rb files and refrain from using the step‑jump mapping until the CVE is patched or the vulnerable plugin is disabled.

Generated by OpenCVE AI on June 11, 2026 at 22:22 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8451-1 Vim vulnerabilities
History
Type Values Removed Values Added
CPEs cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*
Metrics 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'}

Type Values Removed Values Added
Metrics ssvc

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

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
Metrics ssvc

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

Type Values Removed Values Added
Description Vim is an open source, command line text editor. Prior to version 9.2.0496, a code injection vulnerability exists in s:stepmatch() in the cucumber filetype plugin (runtime/ftplugin/cucumber.vim) on Vim builds with +ruby support. Step-definition patterns read from .rb files under the repository's features/*/ or stories/*/ directories are embedded into a Ruby Kernel.eval argument without sufficient escaping, allowing a crafted pattern in an attacker-controlled repository to execute arbitrary Ruby (and through it arbitrary shell commands) when the user invokes a step-jump mapping ([d, ]d). This issue has been patched in version 9.2.0496.
Title Vim: Vimscript Code Injection in cucumber filetype plugin via crafted step-definition regex
Weaknesses CWE-94
CWE-95
References
Metrics cvssV4_0

{'score': 5.1, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:P/VC:L/VI:L/VA:L/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-94

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

  • CWE-95

    Improper Neutralization of Directives in Dynamically Evaluated Code ('Eval Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 12, 2026, 12:47 PM
Reserved
May 18, 2026, 9:25 PM
Status
Analyzed
Published
Jun 11, 2026, 7:16 PM
Modified
Jun 17, 2026, 10:54 AM