CVE-2026-59858 Vim: Arbitrary Code Execution via C Omni-Completion
Attackers can execute arbitrary code by tricking users into opening a malicious C file with a crafted tags file, triggering unsafe command execution in Vim.
- Exploited in the wild
- Not known
- Login needed
- Not needed
- Attackable
- Local or same network only
- Victim action needed
- A user has to click or open something
- Fix
- Available
What is CVE-2026-59858?
CVE-2026-59858 is a high-severity code injection vulnerability in Vim Vim, published on 9 Jul 2026. It can only be exploited from the same machine or local network, and only if a user opens a file or follows a link.
Official description
Vim is an open source, command line text editor. Prior to 9.2.0735, the C omni-completion script in runtime/autoload/ccomplete.vim interpolates the typeref: or typename: extension field of a tags entry, without escaping, into a :vimgrep pattern that is run through :execute. Because :vimgrep honors the bar as a command separator, a crafted tag field can close the search pattern and append an arbitrary Ex command; opening a hostile .c file whose project tags file contains such an entry and invoking C omni-completion runs that command as the editing user. This issue is fixed in version 9.2.0735.
Weakness: CWE-94
Which versions are affected by CVE-2026-59858?
It affects 1 product.
Products include Vim Vim.
How do I fix CVE-2026-59858?
Upgrade to a fixed version.
Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.
Is CVE-2026-59858 being exploited?
There is no known exploitation of CVE-2026-59858 in the wild and no public exploit code.
Other vulnerabilities in Vim Vim
Sources
Also known as ALPINE-CVE-2026-59858, BELL-CVE-2026-59858, CLSA-2026-1784036814, CLSA-2026-1784038367, CLSA-2026-1784042868, CLSA-2026-1784799349 and 12 more.