
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-57456 is an arbitrary code execution vulnerability in Vim's Python omni-completion feature, classified as "Arbitrary Code Execution via Python Omni-Completion Docstrings." It affects all Vim versions prior to 9.2.0699 that are built with +python3 or +python support. The vulnerability was reported by researcher "morningbread" (Chenyuan Mi), disclosed via GitHub Security Advisory on June 21, 2026, and published to NVD on June 25, 2026. It carries a CVSS v3.1 base score of 7.8 (High) and a CVSS v4.0 base score of 8.4 (High) (GitHub Advisory, Feedly).
The root cause is improper control of code generation (CWE-94) in runtime/autoload/python3complete.vim and the legacy pythoncomplete.vim. These scripts reconstruct function and class definitions from the current buffer and pass them to Python's exec() to populate the completion dictionary. Docstrings are inserted verbatim between triple quotes (""") with no escaping — the doc() helper only strips leading/trailing quote and whitespace characters, so an embedded """ sequence within a docstring survives and breaks out of the generated triple-quoted literal. An attacker crafts a hostile Python buffer containing a specially formed docstring (e.g., 'x""" + malicious expression + """y') that, when the completion code is reconstructed and exec()'d, causes the injected Python expression to be evaluated at class-definition time. This is a follow-on to a prior incomplete fix (GHSA-65p9-mwwx-7468, patch 9.2.0597) that sanitized parameter defaults and class base lists but left the docstring path unaddressed (GitHub Advisory, Vim Commit).
Successful exploitation allows an attacker to execute arbitrary Python code within the victim's Vim process, running with the full privileges of the user who opened the file. This results in high confidentiality, integrity, and availability impact on the local system — an attacker could read sensitive files, modify data, install malware, or establish persistence. Vim instances built without +python3 and +python support are not affected; exploitation also requires the user to actively trigger omni-completion (e.g., via CTRL-X CTRL-O) in the hostile buffer, so merely opening the file is insufficient (GitHub Advisory, Feedly).
""" sequence to break out of the triple-quoted literal, followed by an attacker-controlled Python expression. For example:class Foo:
'x"""' + open("/tmp/pwned", "w").close() + '"""y'
pass
Foo..py file via a code repository, email attachment, shared project, or any other means that causes the target to open it in Vim.CTRL-X CTRL-O, or automatically via a Vim plugin that invokes the completion function on Python buffers.python3complete.vim (or pythoncomplete.vim) reconstructs the buffer's class/function definitions and passes the result to exec(). The embedded """ breaks out of the triple-quoted docstring literal, and the attacker's Python expression is evaluated with the privileges of the Vim process (GitHub Advisory, Vim Commit)./tmp/, ~/.config/, home directory) shortly after a Vim session involving Python file editing; new scripts or cron entries added under the user's account.python3, bash, sh, curl, wget) during or immediately after an editing session on a Python file..py files followed by unexpected network connections or file creation events.The fix is available in Vim 9.2.0699, released June 21, 2026. The patch replaces verbatim docstring insertion with Python's repr() function, ensuring docstrings are properly escaped before being passed to exec() (Vim Commit, Vim Release). Ubuntu has issued security notice USN-8500-1 for this vulnerability. Until patching is possible, users should avoid opening untrusted Python files in Vim, disable Python omni-completion (e.g., by removing or not loading python3complete.vim/pythoncomplete.vim), or use a Vim build compiled without +python3/+python support. Upgrading to Vim 9.2.0699 or later is the recommended remediation (GitHub Advisory, Ubuntu Advisory).
The vulnerability was acknowledged and fixed by Vim maintainer Christian Brabandt (chrisbra), who credited researcher Chenyuan Mi ("morningbread") for reporting, analyzing, and suggesting the fix (GitHub Advisory). The Yocto Project security mailing list flagged the issue for embedded Linux distributions. Tenable published Nessus detection plugins (IDs 323747 and 324991) and a container security plugin (443965) for the vulnerability. The issue received coverage in the Hawk-Eye weekly threat landscape digest for Week 27 of 2026, noting it as part of the broader trend of editor-based code injection vulnerabilities.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."