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

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. 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

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.