# CVE-2026-52858: Vim: Arbitrary Code Execution via Python Omni-Completion

> Attackers can execute arbitrary code by tricking users into opening malicious Python files and triggering omni-completion in Vim.

- **Severity:** High 7.3 (`CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N`)
- **Exploited in the wild:** Not known
- **Login needed:** Any signed-in user
- **Attackable:** Over the internet
- **Victim action needed:** A user has to click or open something
- **Fix available:** Yes
- **Published:** 11 Jun 2026
- **Updated:** 12 Jun 2026
- **Also known as:** ALPINE-CVE-2026-52858, AZL-89781, BELL-CVE-2026-52858, CLSA-2026-1782152616, CLSA-2026-1782153265, DEBIAN-CVE-2026-52858, ECHO-c2a9-cb6f-d4b0, GHSA-52mc-rq6p-rc7c, MINI-vr9g-9j97-64h5, ROOT-OS-DEBIAN-11-CVE-2026-52858, ROOT-OS-DEBIAN-12-CVE-2026-52858, UBUNTU-CVE-2026-52858

## What is CVE-2026-52858?

CVE-2026-52858 is a high-severity code injection vulnerability in Vim Vim, published on 11 Jun 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.

### Official description

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.

Weakness: CWE-95 (Improper Neutralization of Directives in Dynamically Evaluated Code), CWE-94 (Improper Control of Generation of Code), CWE-829 (Inclusion of Functionality from Untrusted Control Sphere)

## Which versions are affected by CVE-2026-52858?

It affects 1 product.


Products: Vim Vim.

## How do I fix CVE-2026-52858?

Upgrade to a fixed version.

## Is CVE-2026-52858 being exploited?

There is no known exploitation of CVE-2026-52858 in the wild and no public exploit code.

## Other vulnerabilities in Vim Vim

- [CVE-2020-20703](https://insights.sbomify.com/CVE-2020-20703/): Memory corruption in n/a (critical 9.8)
- [CVE-2017-6349](https://insights.sbomify.com/CVE-2017-6349/): Integer overflow in n/a (critical 9.8)
- [CVE-2017-6350](https://insights.sbomify.com/CVE-2017-6350/): Integer overflow in n/a (critical 9.8)
- [CVE-2017-5953](https://insights.sbomify.com/CVE-2017-5953/): Integer overflow in n/a (critical 9.8)
- [CVE-2008-3075](https://insights.sbomify.com/CVE-2008-3075/): Command injection in n/a (critical 9.3)

## Fix prompt for AI coding agents

```text
Check this codebase for CVE-2026-52858 and fix it if it is affected.

What it is: CVE-2026-52858 is a high-severity code injection vulnerability in Vim Vim, published on 11 Jun 2026. Any signed-in user can exploit it over the network, and only if a user opens a file or follows a link.
Exploitation: There is no known exploitation of CVE-2026-52858 in the wild and no public exploit code.

Affected product: Vim Vim. No package-level version data is available, so check the vendor advisory linked from the reference page.

Task:
1. Search the dependency manifests and lockfiles (for example package.json, package-lock.json, requirements.txt, poetry.lock, uv.lock, pom.xml, build.gradle, go.mod, Cargo.lock, Gemfile.lock) and any Dockerfiles for the affected packages, including transitive dependencies.
2. If an affected version is in use, upgrade it to the fixed version for its release line with the project's package manager, so the lockfile is regenerated. Prefer the smallest upgrade that fixes it.
3. If there is no fix, or the upgrade would break the build, do not guess: explain the risk and the safest workaround instead.
4. Run the tests and summarise what changed and why.
5. If nothing in the project is affected, say so and change nothing.

Reference: https://insights.sbomify.com/CVE-2026-52858/ (Markdown: https://insights.sbomify.com/CVE-2026-52858/index.md)
```

## Sources

- CVE record: https://www.cve.org/CVERecord?id=CVE-2026-52858
- NVD: https://nvd.nist.gov/vuln/detail/CVE-2026-52858
- OSV: https://osv.dev/vulnerability/CVE-2026-52858

---
From sbomify Insights: https://insights.sbomify.com/CVE-2026-52858/
Summaries are generated and may contain mistakes; the official description above is the record.
