CVE-2026-34982

Vim modeline bypass via various options affects Vim < 9.2.0276

Published Apr 6, 2026 CVSS 3.1 · 8.2 High EPSS < 1% KEV · Not listed
Description
Vim is an open source, command line text editor. Prior to version 9.2.0276, a modeline sandbox bypass in Vim allows arbitrary OS command execution when a user opens a crafted file. The `complete`, `guitabtooltip` and `printheader` options are missing the `P_MLE` flag, allowing a modeline to be executed. Additionally, the `mapset()` function lacks a `check_secure()` call, allowing it to be abused from sandboxed expressions. Commit 9.2.0276 fixes the issue.

Analysis

AI-generated

Technical impact

A modeline sandbox bypass in Vim allows arbitrary OS command execution when a user opens a specially crafted file. The missing P_MLE flag in several options enables the modeline to run commands. In addition, mapset() can be abused by sandboxed expressions. The vulnerability is a classic command injection flaw (CWE‑78) that can compromise confidentiality, integrity, and availability by allowing an attacker to run system commands with the privileges of the Vim process.

Affected Systems

The flaw affects the open‑source Vim text editor, specifically all releases older than 9.2.0276. Users of Vim 9.2.0275 and earlier are susceptible. The vulnerability is present in the main Vim distribution (vim:vim) and any derivative that has not applied the patch from commit 75661a66a1db1e1f3f1245c615.

Risk and Exploitability

The CVSS score of 8.2 reflects high severity. The EPSS score is not reported, but the vulnerability is not listed in CISA's KEV catalog, indicating no known widespread exploitation. The likely attack vector is local or when an attacker can prompt a user to open a crafted file, such as through a shared drive or email attachment. Exploitation requires no special permissions beyond the victim’s Vim session, making it an attractive target for attackers seeking privilege escalation on a compromised machine.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply Vim update 9.2.0276 or newer to resolve the issue.
  • If updating is not immediately possible, disable modeline parsing by setting the 'modeline' option to off until a patch is applied.
  • Avoid using the 'complete', 'guitabtooltip', or 'printheader' options with untrusted files.
  • Do not execute 'mapset()' in sandboxed or untrusted expressions.
  • Verify the integrity of Vim binaries and ensure they match official signatures.

Generated by OpenCVE AI on April 6, 2026 at 17:37 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Ubuntu USN Ubuntu USN USN-8171-1 Vim vulnerabilities
References
Link Providers
http://www.openwall.com/lists/oss-security/2026/04/01/1 cve-icon cve-icon
https://access.redhat.com/errata/RHSA-2026:11389 cve-icon
https://access.redhat.com/errata/RHSA-2026:11509 cve-icon
https://access.redhat.com/errata/RHSA-2026:11510 cve-icon
https://access.redhat.com/errata/RHSA-2026:19073 cve-icon
https://access.redhat.com/errata/RHSA-2026:19224 cve-icon
https://access.redhat.com/errata/RHSA-2026:21275 cve-icon
https://access.redhat.com/errata/RHSA-2026:22634 cve-icon
https://access.redhat.com/errata/RHSA-2026:28049 cve-icon
https://access.redhat.com/errata/RHSA-2026:28050 cve-icon
https://access.redhat.com/errata/RHSA-2026:28133 cve-icon
https://access.redhat.com/errata/RHSA-2026:30078 cve-icon
https://access.redhat.com/errata/RHSA-2026:30087 cve-icon
https://access.redhat.com/errata/RHSA-2026:30088 cve-icon
https://access.redhat.com/errata/RHSA-2026:30089 cve-icon
https://access.redhat.com/errata/RHSA-2026:30900 cve-icon
https://access.redhat.com/errata/RHSA-2026:33453 cve-icon
https://access.redhat.com/errata/RHSA-2026:34476 cve-icon
https://access.redhat.com/errata/RHSA-2026:34477 cve-icon
https://access.redhat.com/errata/RHSA-2026:36004 cve-icon
https://access.redhat.com/errata/RHSA-2026:36005 cve-icon
https://access.redhat.com/errata/RHSA-2026:36006 cve-icon
https://access.redhat.com/errata/RHSA-2026:56786 cve-icon
https://access.redhat.com/errata/RHSA-2026:56853 cve-icon
https://access.redhat.com/errata/RHSA-2026:56911 cve-icon
https://access.redhat.com/errata/RHSA-2026:57402 cve-icon
https://access.redhat.com/errata/RHSA-2026:57483 cve-icon
https://access.redhat.com/errata/RHSA-2026:58981 cve-icon
https://access.redhat.com/errata/RHSA-2026:59831 cve-icon
https://access.redhat.com/errata/RHSA-2026:60019 cve-icon
https://access.redhat.com/errata/RHSA-2026:65839 cve-icon
https://access.redhat.com/errata/RHSA-2026:68711 cve-icon
https://access.redhat.com/security/cve/CVE-2026-34982 cve-icon
https://bugzilla.redhat.com/show_bug.cgi?id=2455400 cve-icon
https://github.com/vim/vim/commit/75661a66a1db1e1f3f1245c615 cve-icon cve-icon cve-icon
https://github.com/vim/vim/releases/tag/v9.2.0276 cve-icon cve-icon cve-icon
https://github.com/vim/vim/security/advisories/GHSA-8h6p-m6gr-mpw9 cve-icon cve-icon cve-icon
https://nvd.nist.gov/vuln/detail/CVE-2026-34982 cve-icon
https://security.access.redhat.com/data/csaf/v2/vex/2026/cve-2026-34982.json cve-icon
https://www.cve.org/CVERecord?id=CVE-2026-34982 cve-icon
History
Type Values Removed Values Added
CPEs cpe:2.3:a:vim:vim:*:*:*:*:*:*:*:*
Type Values Removed Values Added
First Time appeared Vim
Vim vim
Vendors & Products Vim
Vim vim
References
Metrics threat_severity

None

threat_severity

Important

Type Values Removed Values Added
References
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

Type Values Removed Values Added
Description Vim is an open source, command line text editor. Prior to version 9.2.0276, a modeline sandbox bypass in Vim allows arbitrary OS command execution when a user opens a crafted file. The `complete`, `guitabtooltip` and `printheader` options are missing the `P_MLE` flag, allowing a modeline to be executed. Additionally, the `mapset()` function lacks a `check_secure()` call, allowing it to be abused from sandboxed expressions. Commit 9.2.0276 fixes the issue.
Title Vim modeline bypass via various options affects Vim < 9.2.0276
Weaknesses CWE-78
References
Metrics cvssV3_1

{'score': 8.2, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:N'}

Weaknesses
  • CWE-78

    Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection')

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Sep 18, 2026, 12:04 PM
Reserved
Mar 31, 2026, 7:38 PM
Status
Modified
Published
Apr 6, 2026, 4:16 PM
Modified
Oct 24, 2026, 1:10 PM
Severity
Important
Public date
Apr 6, 2026, 3:16 PM