CVE-2026-52860: Vim: Arbitrary Code Execution via Python Omni-Completion
Vim is an open source, command line text editor. Prior to version 9.2.0597, Vim's Python omni-completion executes reconstructed function and class definitions from the current buffer with exec() as part of populating the completion dictionary. Python evaluates function default values, parameter annotations, and class base expressions at definition time, so a hostile buffer can execute attacker-controlled Python expressions during omni-completion. The existing g:pythoncomplete_allow_import mitigation (GHSA-52mc-rq6p-rc7c) does not cover this path, because the attacker-controlled code is not a harvested import/from statement. This issue has been patched in version 9.2.0597.
Metrics
- CVSS v4.0
- 7.5
- Severity
- HIGH
- Fixed in
- —
- Affected Products
- 1
HarborGuard Analysis
Synopsis
This is an arbitrary code execution vulnerability in Vim's Python omni-completion feature. The flaw is reachable over the network with no authentication required, but a victim must open a maliciously crafted file and trigger omni-completion, making user interaction a necessary step. Successful exploitation gives an attacker full control over the victim's process, including the ability to read, modify, or destroy data accessible to that user. A patched-image rebuild at version 9.2.0597 is available on HarborGuard for affected environments.
HarborGuard Coverage
Detection of CVE-2026-52860 is available across every HarborGuard environment; the CVE is ingested from upstream advisory feeds within minutes of publication and matched against customer images, including custom-built images that package Vim. Any image carrying a vim binary older than 9.2.0597 will be flagged automatically.
AvailableHarborGuard is capable of scoring this finding at CVSS 7.5 HIGH and weighting it against each environment's compliance policy to determine urgency and routing. Per-org routing rules can direct the alert to the appropriate team inbox based on image ownership or policy tag.
AvailableA patched-image rebuild at vim 9.2.0597 becomes available through HarborGuard once the upstream fix is confirmed present in the base image or package layer. For customers who opt into auto-remediation, HarborGuard performs the rebuild, runs a regression test pass, and opens a PR against affected workloads automatically.
Pending upstreamExploit Conditions
- Network reachabilityRequired
The attack is delivered over the network, typically by distributing a hostile file to a victim who opens it in Vim.
- AuthenticationNot required
No account or credential on the target system is required; the attacker only needs to get the victim to open a crafted file.
- Victim interactionRequired
The victim must open the attacker-controlled buffer and trigger Python omni-completion, making social engineering a prerequisite.
- Attack complexityDetail
While the exploit itself is reliable and condition-free once the file is opened, the CVSS attack requirements note an additional prerequisite condition (AT:P), meaning specific deployment or configuration circumstances must be present.
Blast Radius
- Attacker executes arbitrary Python expressions with the privileges of the user running Vim, gaining full code execution in that process context.
- Confidential data readable by that user, including files, environment variables, and credentials in memory, is directly accessible.
- The attacker can write or overwrite files accessible to the victim user, modifying source code, configuration, or other persisted data.
- The running Vim process and any subprocess it spawns can be crashed or hijacked, disrupting the victim's workflow and any dependent tooling.
How HarborGuard Handles This
Available on HarborGuard: any image containing vim older than 9.2.0597 is flagged within minutes of the CVE entering the upstream feed. Because no fix versions were published at time of initial advisory ingestion, HarborGuard re-checks the advisory on each ingest cycle and will make the patched-image rebuild available automatically once 9.2.0597 is confirmed in the upstream package repositories. For customers who opt into auto-remediation, the rebuild, regression run, and PR against affected workloads will trigger without manual intervention. In the interim, compensating controls available to consider include network-policy rules that restrict which pipelines can pull files from untrusted external sources, and disabling Python omni-completion in Vim configurations via 'let g:loaded_pythoncomplete=1' in the vimrc of base images where that feature is not needed. Where compliance policy permits, HarborGuard can surface these configuration-level recommendations as inline annotations on the finding.
- vim / vim< 9.2.0597
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:A/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N