JLSEC-2026-1874: Code Injection
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.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
Vimto a version that resolves this vulnerability.Fixed in 9.2.0496
Event History
Frequently Asked Questions
Who is exposed to this issue?
Users are exposed when they open an attacker-controlled repository containing crafted Ruby step-definition files under features/*/ or stories/*/, use a Vim build compiled with +ruby support, and invoke a step-jump mapping such as [d or ]d.
What action triggers exploitation?
Exploitation requires user interaction: the user must invoke the cucumber plugin's step-jump mapping. The crafted pattern is then incorporated into a Ruby Kernel.eval call, which can execute arbitrary Ruby and potentially shell commands.
Which versions contain the fix?
The issue is patched in Vim version 9.2.0496. Versions prior to 9.2.0496 are affected when the other required conditions are present.
What can be done before updating?
Avoid invoking the cucumber step-jump mappings ([d and ]d) in untrusted repositories, particularly repositories with Ruby files beneath features/*/ or stories/*/. Builds without +ruby support are not described as affected.