Junglewise Threat Intelligence

CVE-2026-52858: Vim arbitrary code execution in Python omni-completion

CVE-2026-52858 · Severity: info · CVSS 7.3 · Published 2026-06-11

Technologies: Vim. Vendors: Vim.

Executive brief

Vim is a widely used command-line text editor. A vulnerability in its Python code-completion feature allows a malicious file to execute arbitrary commands on a user's computer. If a user opens a specially crafted Python file and triggers the 'omni-completion' shortcut, an attacker could gain full access to the user's files, saved credentials, and network.

Technical details

A code injection vulnerability exists in Vim's Python omni-completion scripts (python3complete.vim and pythoncomplete.vim). The scripts parse the current buffer for 'import' and 'from' statements and execute them using Python's import machinery to generate completion suggestions. Because the buffer's working directory is added to the Python search path (sys.path), an attacker can place a malicious Python package in the same directory as a crafted .py file. When a user opens the file and manually invokes omni-completion (CTRL-X CTRL-O), the malicious package's top-level code is executed with the privileges of the Vim user. This affects Vim builds with +python or +python3 enabled. The issue is patched in version 9.2.0561 by disabling the automatic execution of these statements.

Affected products

  • Vim Vim < 9.2.0561

Timeline

  • 2026-05-29: patched: Vim patch v9.2.0561 released
  • 2026-05-31: advisory: GitHub Security Advisory published
  • 2026-06-11: disclosed: CVE published to NVD

References

Related threats