[Security] MacVim affected by GHSA-2fpv-9ff7-xg5w — tar.vim command injection via crafted .tgz filename (vim < 9.2.0479)
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 76/100
- Tipo de issue
- Bug
- Clareza
- Claramente especificada
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- macos, vim
- Domínio
- security
Direção de pesquisa
Comece em runtime/autoload/tar.vim, em tar#Vimuntar(), e compare as duas chamadas a shellescape() com o commit upstream do Vim 3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1. Aplique a correção de segurança upstream e verifique se um nome de arquivo .tgz criado especialmente não permite mais injeção de comandos pelo caminho do gunzip ou gzip.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
MacVim bundles runtime/autoload/tar.vim containing tar#Vimuntar(), which builds :!gunzip and :!gzip -d shell commands using shellescape(tartail) without the {special} flag. On Unix-like systems, Vim re-expands cmdline-special characters (%, #, !, etc.) before passing a :! command to the shell, so a crafted .tgz filename can inject arbitrary shell commands. The fix from vim 9.2.0479 (3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1) has not been applied to macvim r183.
Vulnerability Details
- GHSA: GHSA-2fpv-9ff7-xg5w
- CVE: CVE-2026-46483
- Upstream fix (vim): 9.2.0479 (commit
3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1, 2026-05-14) - Affected code:
runtime/autoload/tar.vim—tar#Vimuntar()function - Vulnerability type: CWE-78 — OS Command Injection
Root Cause
In tar#Vimuntar(), the archive tail filename (tartail = expand("%:t")) is passed to :! commands via shellescape() without the required second argument ({special}=1):
" runtime/autoload/tar.vim lines 809-812 (macvim r183)
if executable("gunzip")
silent exe "!gunzip ".shellescape(tartail)
elseif executable("gzip")
silent exe "!gzip -d ".shellescape(tartail)
As documented in :help shellescape(), when using the result in a :! command, the second argument must be non-zero so that Vim cmdline-special characters are also escaped. Without it, a filename like ';%$(touch pwned)'.tgz causes Vim to expand % and ! before the shell sees the argument.
Suggested Fix
Merge vim patches up to at least 9.2.0479. The fix adds , 1 to both shellescape() calls:
" Fixed (vim 9.2.0479):
if executable("gunzip")
silent exe "!gunzip ".shellescape(tartail, 1)
elseif executable("gzip")
silent exe "!gzip -d ".shellescape(tartail, 1)
References
- Linguagem predominante
- Vim Script
- Estrelas
- 7.9k
- Forks
- 691
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de macvim-dev/macvim
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
macvim-dev/macvim#1697 · 4 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
macvim-dev/macvim#1658 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
macvim-dev/macvim#1657 ·
-
Dificuldade 2/5 Meio dia Facilidade para iniciantes 72/100
macvim-dev/macvim#1653 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 48/100
macvim-dev/macvim#1696 · 1 comentário ·
Todas as issues de macvim-dev/macvim
Issues semelhantes
-
documentation help wanted
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 88/100
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 76/100
AXERA-TECH/ax-llm#75 ·
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
gitbutlerapp/gitbutler#15998 · 1 comentário ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
sympozium-ai/sympozium#627 ·
-
clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:security impact:ux-friction issue-rating: 🦞 diamond lobster P2
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 84/100