CVE-2026-52860: Vim Python omni-completion code injection in function and class definitions

CVE-2026-52860 · Severity: info · CVSS 7.5 · Published 2026-06-11

Vim, a widely used text editor, contains a vulnerability in its Python code-completion feature. If a user opens a specially crafted Python file and triggers the 'omni-completion' feature (typically used for code suggestions), the editor may execute malicious code embedded within that file. This could allow an attacker to take control of the user's system, access private files, or steal credentials.

Technologies: Vim. Vendors: Vim.

Quick answers

Is CVE-2026-52860 exploited in the wild?
No. Junglewise Threat Intelligence has no report of CVE-2026-52860 being exploited in the wild.
How severe is CVE-2026-52860?
Informational severity, with a CVSS score of 7.5, published 11 June 2026.
Which products and versions are affected?
Vim < 9.2.0597.
Is there a fix for CVE-2026-52860?
A patch was published on 2026-06-04: Fixed in Vim version 9.2.0597 Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is CVE-2026-52860 attacked?
It is attacked with local access, in a network appliance.
Am I affected by CVE-2026-52860?
Check whether you run Vim at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

Technical details

A code injection vulnerability exists in Vim's Python omni-completion scripts (pythoncomplete.vim and python3complete.vim). The editor's completion engine parses the current buffer and reconstructs function and class definitions, which are then passed to the Python exec() function to populate a completion dictionary. Because Python evaluates default parameter values, annotations, and class base expressions at definition time, an attacker can embed malicious Python expressions within these components in a buffer. When a user invokes omni-completion (CTRL-X CTRL-O), these expressions are executed in the context of the Vim process. This bypasses previous mitigations (like g:pythoncomplete_allow_import) because the payload is not contained within an import statement. The issue is fixed in version 9.2.0597 by stripping default expressions and annotations from the generated source.

Affected products

  • Vim Vim < 9.2.0597

Timeline

  • 2026-06-04: patched: Fixed in Vim version 9.2.0597
  • 2026-06-04: advisory: GitHub Security Advisory GHSA-65p9-mwwx-7468 published
  • 2026-06-11: disclosed: CVE-2026-52860 published to NVD

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.