# CVE-2026-73077: Vim shell filetype plugin OS command injection via keyword lookup

Source: https://junglewise.ai/threats/cve-2026-73077-vim-shell-filetype-plugin-os-command-injection-via-keyword-lookup  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-08-11. Updated: 2026-09-25  
License: CC BY 4.0 with a link back

CVE-2026-73077 · Severity: info · CVSS 6.3 · Published 2026-08-11

Vim is a widely-used command-line text editor. The bundled shell script filetype plugins fail to properly escape user-selected text when performing keyword lookups, allowing attackers to inject arbitrary shell commands. A user opening a malicious shell script file and pressing the K key on a selected line could unknowingly execute attacker-controlled commands with their user privileges.

Technologies: [Vim](https://junglewise.ai/threats/technologies/vim). Vendors: [Vim](https://junglewise.ai/threats/vendors/vim).

## Quick answers

**Is CVE-2026-73077 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2026-73077 being exploited in the wild.

**How severe is CVE-2026-73077?** Informational severity, with a CVSS score of 6.3, published 11 August 2026.

**Which products and versions are affected?** Vim < 9.2.0839.

**Is there a fix for CVE-2026-73077?** A patch was published on 2026-07-23: Vim 9.2.0839 released Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-73077 attacked?** It is attacked with local access, in a software library.

**Am I affected by CVE-2026-73077?** Check whether you run Vim at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## Technical details

The vulnerability exists in runtime/ftplugin/sh.vim, runtime/ftplugin/zsh.vim, and runtime/ftplugin/ps1.vim, which define buffer-local keywordprg commands that pass Visual-mode selections directly to bash -c, zsh -c, or PowerShell -Command without proper shell metacharacter escaping. The fnameescape() function used by Vim's K command (in Normal mode) omits shell metacharacters like ;, &amp;, (, ), and &gt;, which are only stripped by SHELL_ESC_CHARS in non-Ex-command contexts. In Visual mode, K passes the entire selection verbatim rather than just the keyword, preserving shell metacharacters and allowing command injection. Exploitation requires the victim to deliberately select crafted text in Visual mode and invoke K; Normal-mode K is unaffected. The issue is fixed in Vim 9.2.0839.

## Affected products

- Vim Vim < 9.2.0839

## Timeline

- 2026-07-23: disclosed
- 2026-07-23: patched: Vim 9.2.0839 released
- 2026-08-11: advisory

## References

- [https://github.com/vim/vim/commit/c5a82fe013e73c98004ad7cd4f906b1ad1ed610e](https://github.com/vim/vim/commit/c5a82fe013e73c98004ad7cd4f906b1ad1ed610e)
- [https://github.com/vim/vim/security/advisories/GHSA-r5v6-q6j8-8qw2](https://github.com/vim/vim/security/advisories/GHSA-r5v6-q6j8-8qw2)

## Related threats

- [Vim is an open source, command line text editor. Prior to 9.2.0845, StructMembers() in runtime/autoload/ccomplete.vim…](https://junglewise.ai/threats/cve-2026-73073-vim-is-an-open-source-command-line-text-editor-prior-to-9-2-0845)
- [Vim netrw code injection via menu construction](https://junglewise.ai/threats/cve-2026-73078-vim-netrw-code-injection-via-menu-construction)
- [Vim vimball arbitrary command execution via .VimballRecord](https://junglewise.ai/threats/cve-2026-73076-vim-vimball-arbitrary-command-execution-via-vimballrecord)
- [Vim out-of-bounds access in popup opacity handling](https://junglewise.ai/threats/cve-2026-73075-vim-out-of-bounds-access-in-popup-opacity-handling)
- [Vim heap overflow in text property handling](https://junglewise.ai/threats/cve-2026-73074-vim-heap-overflow-in-text-property-handling)
