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

Source: https://junglewise.ai/threats/cve-2026-52860-vim-python-omni-completion-code-injection-in-function-and-class  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2026-06-11. Updated: 2026-06-11  
License: CC BY 4.0 with a link back

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](https://junglewise.ai/threats/technologies/vim). Vendors: [Vim](https://junglewise.ai/threats/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

- [https://github.com/vim/vim/commit/c8c63673bc4253212820626aeeb75999d9a539d2](https://github.com/vim/vim/commit/c8c63673bc4253212820626aeeb75999d9a539d2)
- [https://github.com/vim/vim/releases/tag/v9.2.0597](https://github.com/vim/vim/releases/tag/v9.2.0597)
- [https://github.com/vim/vim/security/advisories/GHSA-52mc-rq6p-rc7c](https://github.com/vim/vim/security/advisories/GHSA-52mc-rq6p-rc7c)
- [https://github.com/vim/vim/security/advisories/GHSA-65p9-mwwx-7468](https://github.com/vim/vim/security/advisories/GHSA-65p9-mwwx-7468)

## Related threats

- [Vim is an open source, command line text editor. Prior to 9.2.0845, StructMembers() in runtime/autoload/ccomplete.vim…](https://junglewise.ai/threats/cve-2026-73073-vim-is-an-open-source-command-line-text-editor-prior-to-9-2-0845)
- [Vim netrw code injection via menu construction](https://junglewise.ai/threats/cve-2026-73078-vim-netrw-code-injection-via-menu-construction)
- [Vim shell filetype plugin OS command injection via keyword lookup](https://junglewise.ai/threats/cve-2026-73077-vim-shell-filetype-plugin-os-command-injection-via-keyword-lookup)
- [Vim vimball arbitrary command execution via .VimballRecord](https://junglewise.ai/threats/cve-2026-73076-vim-vimball-arbitrary-command-execution-via-vimballrecord)
- [Vim out-of-bounds access in popup opacity handling](https://junglewise.ai/threats/cve-2026-73075-vim-out-of-bounds-access-in-popup-opacity-handling)
