Vim Tabpanel Modeline Escape Vulnerability Allowing Arbitrary Code Execution

Vulnerability

A vulnerability in Vim versions prior to 9.2.0272 allows arbitrary code execution through the `tabpanel` option, which lacks proper modeline security. When a crafted file is opened, the absence of the `P_MLE` flag on `tabpanel` enables injection of expression strings that are executed after the file is opened, bypassing sandbox restrictions. This issue arises because `autocmd_add()` does not include a security check, allowing registered commands to run with the user's privileges.

Impact

Exploitation of this vulnerability leads to arbitrary command execution on the victim's system, with the same privileges as the user running Vim.

Reproduction

To reproduce this vulnerability, open a file containing a crafted modeline that injects a `%{expr}` expression into the `tabpanel` option. Ensure that Vim is running a version prior to 9.2.0272 and that the `modeline` feature is enabled. The injected expression will be executed after the file is opened, taking advantage of the missing security checks in the `autocmd_add()` function.

Remediation

Users can update to Vim version 9.2.0272 or later, where this vulnerability has been patched.

Added: Mar 30, 2026, 7:25 PM
Updated: Mar 30, 2026, 7:25 PM

Vulnerability Rating

Custom Algorithm
spread
7.8
impact
10.0
exploitability
4.8
remediation
7.7
relevance
4.9
threat
4.8
urgency
2.9
incentive
0.0

Our algorithm analyzes dozens of metrics to generate these 8 key vulnerability categories, which are then combined to calculate the overall risk score.