macvim-dev / macvim-dev/macvim

[Security] MacVim affected by CVE-2026-42307 — netrw OS command injection (vim < 9.2.0383)

Open
#1,647 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
7.9k
Forks
691
PR merge metrics
No merged PRs in 30d

Description

[Security] MacVim affected by CVE-2026-42307 — netrw OS command injection (vim < 9.2.0383)

Summary

MacVim bundles the vim source at version 9.2 (patches 1-332 in the current build), which is
below the patched version 9.2.0383 that fixes CVE-2026-42307.

Vulnerability Details

  • Upstream CVE: CVE-2026-42307
  • Inherited from: vim/vim
  • Affected code: runtime/autoload/netrw.vim — netrw standard plugin
  • Vulnerability type: CWE-78 — OS Command Injection
  • Fixed in: vim 9.2.0383 (commit 405e2fb6d54d5653523809e2853d99d1c000a5fc)

Root Cause

Prior to vim 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. Netrw
constructs shell commands from user-controlled URL components without adequate sanitization.

An attacker who can trick a user into opening a specially crafted URL in vim (e.g., via a
malicious link in a file opened for editing) can achieve arbitrary command execution.

Affected MacVim Version

MacVim r183 (vim 9.2 patches 1-332) — current HEAD as of 2026-05-18.

The fix commit 405e2fb6d54d5653523809e2853d99d1c000a5fc from vim/vim is not present
in the macvim-dev/macvim repository:

git log --all --oneline | grep 405e2fb6  # returns no output

Suggested Fix

Merge or cherry-pick vim/vim patches up to at least 9.2.0383:

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the bundled runtime/autoload/netrw.vim and Vim patches in MacVim with upstream commit 405e2fb6d54d5653523809e2853d99d1c000a5fc. Confirm the bundled Vim version reaches at least 9.2.0383, then build MacVim and verify the upstream security fix is present.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.