/

CVE-2026-73076

Severity:

HIGH RISK

(7.8)

Code Injection (CWE-94) in Vim Vimball Runtime Script

CVE-2026-73076

Analyzed

Vulnerability type

Category:

Code Injection

CWE:

CWE-94, CWE-829

Impact:

Arbitrary Command Execution

Severity:

HIGH RISK

(7.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

A command injection vulnerability in Vim's Vimball runtime allows a crafted archive member to overwrite an installation record with attacker-controlled Ex commands. If the affected record is later processed by vimball#RmVimball(), those commands may execute with the privileges of the user running Vim, including operating-system commands.

A command injection vulnerability in Vim's Vimball runtime allows a crafted archive member to overwrite an installation record with attacker-controlled Ex commands. If the affected record is later processed by vimball#RmVimball(), those commands may execute with the privileges of the user running Vim, including operating-system commands.

Affected context

The issue occurs in Vim installations that use the vulnerable Vimball runtime functionality to manage archived scripts or plugins. Risk increases when Vim processes a Vimball containing a specially named member and later removes or otherwise handles the corresponding installation record.

The issue occurs in Vim installations that use the vulnerable Vimball runtime functionality to manage archived scripts or plugins. Risk increases when Vim processes a Vimball containing a specially named member and later removes or otherwise handles the corresponding installation record.

Exploit preconditions

  • Attack surface: Vimball archive handling and runtime installation-record processing
  • Required access: Ability to provide or cause Vim to process a crafted Vimball archive
  • Trigger point: Later processing of the matching record by vimball#RmVimball()
  • Why exploitation is possible: The archive can influence stored Ex commands, which are subsequently interpreted as executable Vim commands
  • Attack surface: Vimball archive handling and runtime installation-record processing
  • Required access: Ability to provide or cause Vim to process a crafted Vimball archive
  • Trigger point: Later processing of the matching record by vimball#RmVimball()
  • Why exploitation is possible: The archive can influence stored Ex commands, which are subsequently interpreted as executable Vim commands

Why this happens

The vulnerability results from treating archive-controlled metadata as trusted executable command content. A specially named Vimball member can overwrite an installation record, and later record processing evaluates the stored Ex commands without adequately separating data from code. This maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced content is incorporated into commands that may be executed. The related CWE-829 classification reflects the risk associated with executing functionality obtained from an untrusted or insufficiently trusted source.

The vulnerability results from treating archive-controlled metadata as trusted executable command content. A specially named Vimball member can overwrite an installation record, and later record processing evaluates the stored Ex commands without adequately separating data from code. This maps to CWE-94: Improper Control of Generation of Code, because attacker-influenced content is incorporated into commands that may be executed. The related CWE-829 classification reflects the risk associated with executing functionality obtained from an untrusted or insufficiently trusted source.

Potential impact

  • Arbitrary Ex command execution may occur in the Vim process
  • Operating-system commands could execute with the current user's privileges
  • User files or development assets may be modified or disclosed
  • The Vim runtime or installed plugins could be altered
  • Compromise could enable follow-on activity within the user's environment
  • Arbitrary Ex command execution may occur in the Vim process
  • Operating-system commands could execute with the current user's privileges
  • User files or development assets may be modified or disclosed
  • The Vim runtime or installed plugins could be altered
  • Compromise could enable follow-on activity within the user's environment

General mitigation guidance

Mitigation generally focuses on preventing archive-controlled data from becoming executable command content and reducing the trust placed in Vimball metadata.

Common defensive patterns include:

  • Use Vim implementations containing the security fix for this issue
  • Treat archive names, metadata, and installation records as untrusted input
  • Store structured records as data and avoid evaluating their contents as commands
  • Apply strict allowlists for supported record operations and reject unexpected commands
  • Require explicit user confirmation before processing untrusted archives or removing managed content
  • Run editor workflows with least privilege and isolate untrusted files where practical

Mitigation generally focuses on preventing archive-controlled data from becoming executable command content and reducing the trust placed in Vimball metadata.

Common defensive patterns include:

  • Use Vim implementations containing the security fix for this issue
  • Treat archive names, metadata, and installation records as untrusted input
  • Store structured records as data and avoid evaluating their contents as commands
  • Apply strict allowlists for supported record operations and reject unexpected commands
  • Require explicit user confirmation before processing untrusted archives or removing managed content
  • Run editor workflows with least privilege and isolate untrusted files where practical

How teams detect issues like this

Organizations can look for this class of issue through:

  • Static analysis rules that identify dynamic execution of archive metadata or record contents
  • Code review checks for command construction from filenames, archive members, or configuration records
  • Tests that verify special archive members cannot alter executable runtime state
  • Monitoring for unexpected Vim Ex commands or operating-system process launches during Vimball operations
  • Policy enforcement that restricts processing of untrusted plugin packages in privileged user sessions

Neutral automated code review and dependency-analysis tools may help identify unsafe command-generation patterns.

Organizations can look for this class of issue through:

  • Static analysis rules that identify dynamic execution of archive metadata or record contents
  • Code review checks for command construction from filenames, archive members, or configuration records
  • Tests that verify special archive members cannot alter executable runtime state
  • Monitoring for unexpected Vim Ex commands or operating-system process launches during Vimball operations
  • Policy enforcement that restricts processing of untrusted plugin packages in privileged user sessions

Neutral automated code review and dependency-analysis tools may help identify unsafe command-generation patterns.

Sources

SourceLink
github.comgithub.com/vim/vim/commit/581a2f3ac9c6f96a26324f6b2c8c11415fd0d452
github.comgithub.com/vim/vim/security/advisories/GHSA-r22p-fhw4-84p2

Frequently asked

questions

Not inherently. Exploitation generally requires a crafted Vimball archive to reach a Vim instance, such as through a downloaded plugin, shared file, or other untrusted input. Remote impact depends on how that archive is delivered.

The attacker needs a way to supply or influence a Vimball archive that the victim opens or processes. No separate administrative access is necessarily required, but command execution is limited by the privileges of the user running Vim.

Use a Vim version containing the security fix and ensure archive metadata is treated strictly as data rather than executable Ex commands. Validation and allowlisting should occur before any record is stored or processed.

Restrict untrusted plugin and archive sources, review dynamic command-generation paths, test archive edge cases, and run editor workflows with least privilege.

Not inherently. Exploitation generally requires a crafted Vimball archive to reach a Vim instance, such as through a downloaded plugin, shared file, or other untrusted input. Remote impact depends on how that archive is delivered.

The attacker needs a way to supply or influence a Vimball archive that the victim opens or processes. No separate administrative access is necessarily required, but command execution is limited by the privileges of the user running Vim.

Use a Vim version containing the security fix and ensure archive metadata is treated strictly as data rather than executable Ex commands. Validation and allowlisting should occur before any record is stored or processed.

Restrict untrusted plugin and archive sources, review dynamic command-generation paths, test archive edge cases, and run editor workflows with least privilege.

Find out what's already
exploitable in your codebase.