
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-34982 is a modeline sandbox bypass vulnerability in Vim that allows arbitrary OS command execution when a user opens a crafted file. It affects all Vim versions prior to 9.2.0276 and was disclosed on March 31, 2026, with a CVE assigned on April 6, 2026. The vulnerability was reported by researchers "dfwjj x" and "Avishay Matayev" and fixed in commit 75661a6 (patch v9.2.0276). It carries a CVSS v3.1 base score of 8.2 (High) (GitHub Advisory, Openwall OSS-Sec).
The root cause is classified as CWE-78 (OS Command Injection) and stems from two related flaws in Vim's modeline sandbox enforcement. First, the complete, guitabtooltip, and printheader options are missing the P_MLE flag in src/optiondefs.h, which means the modeline security check at src/option.c:1565-1571 is bypassed — allowing arbitrary lambda expressions (e.g., F{func} syntax in complete) to be set from a modeline. Second, the mapset() function lacks a check_secure() call, enabling it to be abused from within sandboxed expressions to register arbitrary key mappings that execute OS commands. Exploitation requires only that a victim open a specially crafted file in a vulnerable Vim instance — no special privileges are needed (GitHub Advisory, Vim Commit).
Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the user running Vim, simply by delivering a crafted file. This results in high confidentiality and integrity impact — an attacker could exfiltrate sensitive data, modify files, or establish persistence on the affected system. Availability is not directly impacted by the vulnerability itself, but secondary effects of arbitrary command execution (e.g., file deletion, process termination) are possible (GitHub Advisory, Red Hat CVE).
vim: set complete=F{->system('malicious_command')} : to abuse the complete option's lambda callback syntax, or use vim: set guitabtooltip=%{%mapset()%}: to abuse mapset() via guitabtooltip.P_MLE flag, the modeline security check is bypassed. The lambda expression or mapset() call executes within what should be a sandboxed context.system('touch_should_not_run')) executes as an OS command with the privileges of the user running Vim, enabling file creation, data exfiltration, reverse shell establishment, or other malicious actions (GitHub Advisory, Vim Commit).touch_should_not_run or similar artifacts from test payloads); new scripts or executables in user home or temp directories shortly after opening a file in Vim.sh, bash, curl, wget, python) visible in process trees; system() calls originating from Vim sessions.auditd records of execve syscalls with Vim as the parent process.Upgrade Vim to version 9.2.0276 or later, which adds the P_MLE flag to the complete, guitabtooltip, and printheader options and adds a check_secure() call to mapset() (Vim Release, Vim Commit). As an interim workaround, disable modeline processing by adding set nomodeline to your Vim configuration (~/.vimrc or /etc/vim/vimrc), which prevents modelines in files from being evaluated entirely. Users should also avoid opening Vim files from untrusted or unknown sources. Downstream distributions including Red Hat, Ubuntu, Amazon Linux, openSUSE, and IBM have released or are releasing updated packages (Red Hat Errata, IBM Advisory).
The vulnerability received coverage from multiple security news outlets including GBHackers, CyberSecurityNews, and The Hacker News (in a weekly recap), reflecting moderate community interest (GBHackers, The Hacker News). The Vim maintainer Christian Brabandt published the fix and coordinated disclosure via the oss-security mailing list and GitHub Security Advisories. Downstream Linux distributions (Red Hat, Ubuntu, Amazon Linux, openSUSE, Mageia, Fedora) responded promptly with updated packages, indicating the security community treated this as a significant but manageable issue.
Source: This report was generated using AI
Free Vulnerability Assessment
Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.
Get a personalized demo
"Best User Experience I have ever seen, provides full visibility to cloud workloads."
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
"We know that if Wiz identifies something as critical, it actually is."