Junglewise Threat Intelligence

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

Technologies: Vim. Vendors: Vim.

Executive brief

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.

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

Related threats