CVE-2026-57456
vim: Vim: Arbitrary code execution via malicious docstrings in Python omni-completion
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · June 26, 2026
Updated · October 30, 2026
Description
There is a security flaw in Vim. If you use Vim to open a malicious file written by a hacker, and you use the auto-complete feature while typing, the file can secretly force your computer to run unauthorized commands or malware.
Statement
This flaw is rated as Important. A vulnerability in Vim's Python omni-completion feature allows for arbitrary code execution. By opening a specially crafted file, a local attacker could execute arbitrary Python code due to improper handling of docstrings during omni-completion, leading to a compromise of the system where Vim is running.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
To mitigate this vulnerability, users should avoid opening untrusted Python files or using Python omni-completion on such files. If Python omni-completion is not required, it can be disabled by adding autocmd FileType python setlocal omnifunc= to your .vimrc file. This will prevent the vulnerable code from being executed. Disabling Python omni-completion will remove the ability to use Ctrl-X Ctrl-O for Python code completion. A restart of Vim is required for the changes to take effect.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CWE-94 · Improper Control of Generation of Code ('Code Injection')