CVE-2026-52858·Python vulnerability
Vim is an open source, command line text editor. Prior to version 9.2.0561, the Python omni-completion script in python3complete.vim for Vim with the +python3 interpreter enabled (and the legacy pythoncomplete.vim for builds with the +python interpreter) executes the import and from statements found in the current buffer through Python's import machinery. Because the buffer's working directory is on sys.path, opening a hostile .py file with a sibling Python package and invoking omni-completion runs that package's top-level code as the editing user. This issue has been patched in version 9.2.0561.
- Severity
- high
- Software
- Python
- Fixed in
- 9.2.0561
- Published
- 2026-06-11
Affected versions
Until: 9.2.0561
Fixed in: 9.2.0561
How to fix this CVE
Update Vim to version 9.2.0561 or later to patch the Python omni-completion vulnerability. The issue allows arbitrary code execution when opening untrusted Python files with sibling packages due to improper handling of import statements during auto-completion. Ensure your Vim installation includes the +python3 feature and apply the security update promptly.
sudo dnf update vim vim-commonDefensia detects this vulnerability
How to check if you are affected
- Check Vim version: vim --version | grep -i python3 (confirm +python3 is enabled)
- Verify the installed Vim release: vim --version | head -1 (look for version number before 9.2.0561)
- Search Vim logs for omni-completion invocations: grep -r 'pythoncomplete\|python3complete' ~/.vim/
- Confirm the patch by running: vim --version | grep 'v9.2.0561 or later' or check /usr/share/vim/vim*/doc/version*.txt for patch level
FAQ
What is CVE-2026-52858?
This vulnerability in Vim's Python omni-completion feature allows arbitrary code execution when a user opens a malicious Python file containing import statements alongside a hostile package in the same directory. The auto-completion mechanism inadvertently executes the package's initialization code with the privileges of the editing user.
Is CVE-2026-52858 being actively exploited?
No, this vulnerability is not currently listed on the CISA Known Exploited Vulnerabilities catalog and no public exploits are available, though the attack surface exists for targeted social engineering scenarios.
What versions of Vim are affected by CVE-2026-52858?
All versions of Vim prior to 9.2.0561 are affected, provided the +python3 interpreter feature is enabled during compilation.
How do I check if my server is vulnerable to CVE-2026-52858?
Run 'vim --version | grep python3' to confirm Python3 support is compiled in, then check the version number (if below 9.2.0561, the system is vulnerable). Use 'vim --version | head -1' to display the exact Vim version installed.
Does Defensia detect CVE-2026-52858?
Yes — Defensia's CVE advisory scanner compares installed Vim package versions against the NVD database. If Vim with +python3 support is installed on a monitored server and the version is below 9.2.0561, CVE-2026-52858 will appear in your dashboard with remediation steps.
Related Python CVEs
References
Track CVEs across your fleet automatically
Defensia scans your Linux servers and tells you exactly which ones are running vulnerable versions — including CVE-2026-52858. Free for 1 server.
Get started free