macvim-dev / macvim-dev/macvim

[Security] MacVim affected by CVE-2026-46483 — tar#Vimuntar() command injection via shellescape (vim < 9.2.0479)

オープン
#1,650 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
Vim Script
スター
7.9k
フォーク
691
PR マージ指標
30日以内にマージされた PR はありません

説明

[Security] MacVim affected by CVE-2026-46483 — tar#Vimuntar() command injection via shellescape (vim < 9.2.0479)

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.0479 that fixes CVE-2026-46483.

Vulnerability Details

  • Upstream CVE: CVE-2026-46483
  • Inherited from: vim/vim
  • Affected code: runtime/autoload/tar.vim, function tar#Vimuntar()
  • Vulnerability type: CWE-78 — OS Command Injection
  • Fixed in: vim 9.2.0479 (commit 3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1)

Root Cause

In tar#Vimuntar() (runtime/autoload/tar.vim), the function decompresses a .tgz tarball
using :!gunzip and tar. The filename is escaped using shellescape(tartail) without
the second argument 1:

" runtime/autoload/tar.vim (macvim r183, around line 815)
if tartail =~ '\.tgz'
   if executable("gunzip")
    silent exe "!gunzip ".shellescape(tartail)

When vim's :! command processes the command string, the ! character in the filename
is interpreted by vim's command-line history substitution BEFORE the shell sees it.
shellescape(x, 0) (the default) does not escape ! for the vim :! context, while
shellescape(x, 1) does.

If an attacker can name a .tgz file to contain !command, and trick a user into
running tar#Vimuntar() on it, the embedded command is executed.

Affected MacVim Code

MacVim's runtime/autoload/tar.vim contains the vulnerable tar#Vimuntar() function at
line 784. The fix changes shellescape(tartail) to shellescape(tartail, 1) throughout
the function.

Note: neovim does NOT have the tar#Vimuntar() function and is not affected by this
specific vulnerability.

Affected MacVim Version

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

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

git log --all --oneline | grep 3fb5e58f  # returns no output

Suggested Fix

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

The fix changes shellescape(tartail) to shellescape(tartail, 1) which properly escapes
! characters for vim's :! command context.

References

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

runtime/autoload/tar.vim から始めて tar#Vimuntar() を調査し、特に影響を受けた行付近の .tgz の処理を確認してください。この関数を Vim のコミット 3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1 と比較し、MacVim に Vim 9.2.0479 までの upstream fix が含まれていることを確認してください。脆弱な関数が更新され、変更が適切な検証によってカバーされていれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
macos, vim
領域
operating-systems, security
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
静か
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。