
Cloud Vulnerability DB
A community-led vulnerabilities database
CVE-2026-34714 is a code execution vulnerability in Vim caused by %{expr} injection via the tabpanel option lacking the P_MLE flag, allowing arbitrary OS command execution immediately upon opening a crafted file in the default configuration. It affects Vim versions greater than 9.1.1390 and less than 9.2.0272, with the vulnerability introduced in v9.1.1391. The flaw was disclosed on March 30, 2026, and patched in the same-day release of v9.2.0272. It carries a CVSS v3.1 base score of 8.6 (High) per NVD, and 9.2 (Critical) per ENISA (GitHub Advisory, Red Hat Bugzilla, Openwall OSS-Sec).
The root cause is a two-part bug chain classified under CWE-78 (OS Command Injection) and CWE-917 (Expression Language Injection). First, the tabpanel option in src/optiondefs.h:2581 accepts %{expr} format strings like statusline and tabline, but unlike those options, it is missing the P_MLE flag — meaning the modeline security check at src/option.c:1572-1576 is never triggered, allowing arbitrary expression strings to be injected via modelines without requiring modelineexpr to be enabled. Second, while Vim correctly evaluates the injected expression inside a sandbox (src/eval.c:747-758), the autocmd_add() function at src/autocmd.c:3316 lacks a check_secure() call; the :autocmd ex command is blocked in the sandbox, but the function interface bypasses this restriction, allowing sandboxed code to register an autocommand that fires after the sandbox exits and executes arbitrary OS commands. The fix adds the P_MLE flag to tabpanel and adds check_restricted()/check_secure() guards to autocmd_add() and autocmd_delete() (GitHub Commit, Openwall OSS-Sec).
Successful exploitation allows an attacker to execute arbitrary OS commands with the privileges of the user running Vim, immediately upon the victim opening a crafted file — no further interaction is required. This can lead to complete system compromise including unauthorized data access, data theft, file manipulation, and potential lateral movement within the victim's environment. Because modeline is enabled by default in Vim's FEAT_HUGE build (the standard distribution), and modelineexpr does not need to be enabled, the attack surface is broad and affects most default Vim installations (GitHub Advisory, Openwall OSS-Sec).
tabpanel option with a %{expr} expression, e.g., a line such as /* vim: set tabpanel=%{autocmd_add([{'event':'VimEnter','cmd':'!malicious_command'}])}: */ embedded at the top or bottom of the file.tabpanel to the injected %{expr} string without triggering the P_MLE security check.autocmd_add(), which lacks a check_secure() guard, registering an autocommand (e.g., on VimEnter or BufRead) that executes after the sandbox exits.tabpanel=%{...} or tpl=%{...} expressions; unexpected scripts or executables created in user home or temp directories shortly after opening a file in Vim./bin/sh, bash, curl, wget, python, nc) immediately after file open events; processes running under the user's account with no clear interactive origin.auditd records of execve syscalls from Vim's process tree.Upgrade Vim to version 9.2.0272 or later, which adds the P_MLE flag to the tabpanel option and adds check_secure() guards to autocmd_add()/autocmd_delete() (GitHub Commit, Vim Release). As a temporary workaround, add set nomodeline to your ~/.vimrc to disable modeline processing entirely, which prevents the injection vector from being triggered. Additionally, restrict opening files from untrusted sources with Vim until patching is complete. Linux distribution users should apply vendor-provided updates (e.g., Red Hat, Amazon Linux, openSUSE, Fedora packages) as they become available (Red Hat Bugzilla, Feedly).
The vulnerability was notably highlighted in coverage by CSO Online, InfoWorld, and Network World in the context of AI-assisted vulnerability discovery, as Claude Code was reported to have identified this and a related GNU Emacs zero-day (CSO Online). The Hacker News weekly recap also included the vulnerability in its roundup of notable security events. The oss-security mailing list disclosure by Vim maintainer Christian Brabandt was detailed and well-received, with follow-up discussion threads on oss-sec. The Greenbone April 2026 threat report flagged the vulnerability as noteworthy for enterprise patch prioritization.
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."