Command execution via PowerShell keyword lookup in Vim
Key facts
- Attack vector
- —
- Privileges required
- —
- User interaction
- —
- Attack complexity
- —
- Impact type
- Code execution
- Confidentiality · integrity · availability
- —
- Fix status
- Fixed
No CVSS vector from any source. Fix status from GitHub. Impact type from CWE-78.
Summary
Vim before v9.2.1346 passes the argument of K to PowerShell without escaping typographic single quotes in its PowerShell filetype plugin (CWE-78). The earlier fix doubled only ASCII single quotes, so a crafted line can end the quoted string and run commands. An attacker can exploit this when a user opens a crafted PowerShell script, selects the line in Visual mode and presses K, which runs commands in the context of the user running Vim.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
Description from the GitHub advisory
Command Execution via PowerShell Keyword Lookup in Vim < 9.2.1346 ================================================================= Date: 14.11.2026 Severity: Low CVE: *requested, not yet assigned* CWE: Improper Neutralization of Special Elements used in an OS Command (CWE-78) ## Summary The fix for [GHSA-r5v6-q6j8-8qw2](https://github.com/vim/vim/security/advisories/GHSA-r5v6-q6j8-8qw2) in `runtime/ftplugin/ps1.vim` quotes the argument of `K` for PowerShell by doubling ASCII single quotes. PowerShell also treats the typographic quotes U+2018, U+2019, U+201A and U+201B as single quotes, which were not doubled. A crafted line in a PowerShell script can therefore still execute arbitrary commands when the user selects it and presses `K`. ## Description The PowerShell filetype plugin defines a `:GetHelp` command and sets `keywordprg` to it. The command passes the argument of `K` to PowerShell as `Get-Help -Full '<arg>'` via `-Command`, doubling every `'` in the argument to keep it inside the single-quoted string. The PowerShell language accepts `'`, `‘`, `’`, `‚` and `‛` as single-quote characters. A typographic quote in the argument therefore terminates the string, and the text following it is executed as PowerShell code, e.g. for the line: x’;./hook.ps1;’ ## Impact Arbitrary command execution in the context of the user running Vim. Exploitation requires: - Vim with filetype plugins enabled and PowerShell (`pwsh` or `powershell.exe`) installed - the victim opening a crafted PowerShell script, selecting the crafted line in Visual mode and invoking the keyword lookup with `K`. The severity is rated Low because Normal-mode `K` is not affected and exploitation requires the victim to deliberately select the crafted text in Visual mode and invoke the keyword lookup. ## Acknowledgements The Vim project would like to thank Zachariah Mithani for reporting the issue. ## References The issue has been fixed as of Vim patch [v9.2.1346](https://github.com/vim/vim/releases/tag/v9.2.1346). - [Commit](https://github.com/vim/vim/commit/188a790b05a282926b311503245f5119a5f6f3ed) - [Github Security Advisory](https://github.com/vim/vim/security/advisories/GHSA-XXXX) - [Previous advisory](https://github.com/vim/vim/security/advisories/GHSA-r5v6-q6j8-8qw2)
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| — | Vim (vim) | < v9.2.1346 | v9.2.1346 | Patch available | GHSA-cgcr-vx5v-wf6q |
- Vim (vim) Vendor— Affected < v9.2.1346 Fixed in v9.2.1346 Patch available GHSA-cgcr-vx5v-wf6q
Remediation
Upgrade Vim to v9.2.1346 or later, which contains the fix in Vim patch v9.2.1346.
Written with Claude Haiku 5.5 from the sources below · 2026-11-14
- Fix · GHSA-cgcr-vx5v-wf6q Vim (vim) Fixed in v9.2.1346 Advisory →
Timeline
- 2026-11-14 Threatist record created from GHSA-cgcr-vx5v-wf6q
References
Sources
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences