CVE-2026-42307 Vim: OS Command Injection in netrw
An attacker can execute arbitrary shell commands by tricking a user into opening a crafted URL in Vim's netrw plugin.
- 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-42307?
CVE-2026-42307 is a medium-severity command injection vulnerability in Vim Vim, published on 8 May 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 version 9.2.0383, an OS command injection vulnerability exists in the netrw standard plugin bundled with Vim. By inducing a user to open a crafted URL (e.g., using the sftp:// or file:// protocol handlers), an attacker can execute arbitrary shell commands with the privileges of the Vim process. This issue has been patched in version 9.2.0383.
Weakness: CWE-78
Which versions are affected by CVE-2026-42307?
It affects 1 product.
Products include Vim Vim.
How do I fix CVE-2026-42307?
Upgrade to a fixed version.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2026-42307 being exploited?
There is no known exploitation of CVE-2026-42307 in the wild and no public exploit code.
Other vulnerabilities in Vim Vim
Sources
Also known as ALPINE-CVE-2026-42307, BELL-CVE-2026-42307, CLSA-2026-1779212372, CLSA-2026-1779273587, CLSA-2026-1779279626, CLSA-2026-1779280197 and 9 more.