# CVE-2026-59858: Vim arbitrary command execution in C omni-completion

Source: https://junglewise.ai/threats/cve-2026-59858-vim-arbitrary-command-execution-in-c-omni-completion  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-07-09. Updated: 2026-07-09  
License: CC BY 4.0 with a link back

CVE-2026-59858 · Severity: info · CVSS 8.4 · Published 2026-07-09

Vim is a widely used open-source text editor for programmers. A vulnerability in its C code completion feature allows a specially crafted project file (a 'tags' file) to execute malicious commands on the user's computer. This could occur if a developer opens a third-party code repository and attempts to use the auto-complete function, potentially leading to full system compromise or data theft.

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

## Quick answers

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

**How severe is CVE-2026-59858?** Informational severity, with a CVSS score of 8.4, published 9 July 2026.

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

**Is there a fix for CVE-2026-59858?** A patch was published on 2026-07-09: Fixed in patch 9.2.0735 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2026-59858 attacked?** It is attacked with local access, in an operating system.

**Am I affected by CVE-2026-59858?** 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

A code injection vulnerability exists in Vim's C omni-completion script (runtime/autoload/ccomplete.vim). The script interpolates 'typeref:' or 'typename:' extension fields from a tags entry directly into a :vimgrep pattern executed via :execute without proper escaping. Because :vimgrep treats the pipe character (|) as a command separator, an attacker can craft a tags file where these fields terminate the search pattern and append arbitrary Ex commands. Exploitation occurs when a user opens a C file in a directory with a malicious tags file and triggers omni-completion (CTRL-X CTRL-O) on a struct or union member. This results in arbitrary code execution with the privileges of the user running Vim.

## Affected products

- Vim Vim < 9.2.0735

## Timeline

- 2026-06-26: advisory: GitHub Security Advisory published
- 2026-07-09: disclosed: CVE published to NVD
- 2026-07-09: patched: Fixed in patch 9.2.0735

## References

- [https://github.com/vim/vim/commit/6b611b0d15603c52ebdad17172b0232b4f65704e](https://github.com/vim/vim/commit/6b611b0d15603c52ebdad17172b0232b4f65704e)
- [https://github.com/vim/vim/security/advisories/GHSA-mf92-v4xw-j45x](https://github.com/vim/vim/security/advisories/GHSA-mf92-v4xw-j45x)

## 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 shell filetype plugin OS command injection via keyword lookup](https://junglewise.ai/threats/cve-2026-73077-vim-shell-filetype-plugin-os-command-injection-via-keyword-lookup)
- [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)
