CVE-2026-57456

Vim: Arbitrary Code Execution via Python Omni-Completion Docstrings

Published Jun 25, 2026 CVSS 4.0 · 8.4 High EPSS < 1% KEV · Not listed
Description
Vim is an open source, command line text editor. Prior to 9.2.0699, Vim's Python omni-completion (runtime/autoload/python3complete.vim and the legacy pythoncomplete.vim) executes reconstructed function and class definitions from the current buffer with exec() as part of populating the completion dictionary. When reconstructing that source, each scope's docstring is inserted verbatim between triple quotes with no escaping, so a hostile buffer can break out of the triple-quoted literal and execute attacker-controlled Python during omni-completion. This vulnerability is fixed in 9.2.0699.

Analysis

AI-generated

Technical impact

The vulnerability arises from how Vim's Python omni-completion reconstructs function and class definitions from the current buffer and passes them to exec(). Each docstring is inserted unchanged between triple quotes, with no escaping. A malicious buffer can therefore break out of the string literal and inject arbitrary Python code, which is executed during completion. The flaw is a code injection vulnerability (CWE‑94) that grants arbitrary code execution within the Vim process.

Affected Systems

Ongoing Vim releases up through 9.2.0698, and earlier 9.1.x and 9.0.x versions, are affected. The problem is present in the autoload files python3complete.vim and pythoncomplete.vim, part of the default Vim runtime. All users running Vim with Python omni‑completion enabled are vulnerable unless they upgrade to version 9.2.0699 or later.

Risk and Exploitability

The CVSS score of 8.4 classifies this flaw as high severity, and while EPSS data is not available, the lack of a KEV listing does not reduce the risk of exploitation. An attacker who can influence the contents of a buffer that Vim will process for omnocompletion can trigger arbitrary code execution locally. The attack vector is likely local, but could be leveraged by an attacker who gains elevated privileges to run Vim as a privileged user.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade Vim to 9.2.0699 or later to contain the fix.
  • If an upgrade is not immediately possible, disable the vulnerable python3complete.vim and pythoncomplete.vim autoload files by removing them from your runtime/autoload directory or commenting out their loading in your vimrc.
  • Avoid running Vim with Python omni‑completion enabled in environments where untrusted buffers may be opened, and restrict the use of Vim to non‑privileged users whenever possible.

Generated by OpenCVE AI on June 25, 2026 at 16:35 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8500-1 Vim vulnerabilities
History
Type Values Removed Values Added
First Time appeared Redhat
Redhat hummingbird
CPEs cpe:/a:redhat:hummingbird:1
Vendors & Products Redhat
Redhat hummingbird
References
Metrics threat_severity

None

cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H'}

threat_severity

Important

Type Values Removed Values Added
First Time appeared Vim
Vim vim
Vendors & Products Vim
Vim vim
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Vim is an open source, command line text editor. Prior to 9.2.0699, Vim's Python omni-completion (runtime/autoload/python3complete.vim and the legacy pythoncomplete.vim) executes reconstructed function and class definitions from the current buffer with exec() as part of populating the completion dictionary. When reconstructing that source, each scope's docstring is inserted verbatim between triple quotes with no escaping, so a hostile buffer can break out of the triple-quoted literal and execute attacker-controlled Python during omni-completion. This vulnerability is fixed in 9.2.0699.
Title Vim: Arbitrary Code Execution via Python Omni-Completion Docstrings
Weaknesses CWE-94
References
Metrics cvssV4_0

{'score': 8.4, 'vector': 'CVSS:4.0/AV:L/AC:L/AT:N/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N'}

Weaknesses
  • CWE-94

    Improper Control of Generation of Code ('Code Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Jun 26, 2026, 3:55 AM
Reserved
Jun 24, 2026, 1:21 PM
Status
Analyzed
Published
Jun 25, 2026, 4:16 PM
Modified
Jun 26, 2026, 5:16 AM
Severity
Important
Public date
Jun 25, 2026, 3:16 PM