Skip to main content

GNU Emacs CVE-2026-131959

| EUVDEUVD-2026-128466 HIGH
Inclusion of Functionality from Untrusted Control Sphere (CWE-829)
2026-11-18 mitre GHSA-5hqm-5j9g-jhcr
7.8
CVSS 3.1 · Vendor: mitre
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Plant crafted .dir-locals.el in repo or archive
  2. Exploit
    Victim opens matching file in Emacs 31.1
  3. Execution
    auto-mode-alist FUNCTION invoked before validation
  4. Impact
    Arbitrary Emacs Lisp executes as the user

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V15 - Secure Coding and Architecture Trusted source inclusion only
Exploitation Conditions

Requires the victim to open a file, in Emacs 31.1 specifically, that resides in a directory containing an attacker-controlled .dir-locals.el which registers a (REGEXP FUNCTION t) entry in auto-mode-alist; the typical delivery is a victim cloning or extracting an untrusted repository/archive and then opening a matching file. Limiting factors: AV:L means the malicious file must already be present locally, UI:R means no code runs until the user opens a matching file, exploitation is confined to version 31.1 (30.2 is not affected), and the upstream fix commit 205ae0b closes the validation gap - updating is the remediation the evidence provides.

Impact

The signals point to a genuine but context-bound developer-workstation risk rather than a mass-exploitation emergency. CVSS 7.8 (High) is driven by full C:H/I:H/A:H impact - arbitrary Emacs Lisp execution equals complete compromise of the user's account and data - but the AV:L (local) and UI:R (user-interaction) metrics materially bound reach: the malicious .dir-locals.el must already be present on the filesystem and the victim must open a matching file in the vulnerable build. No EPSS score was supplied and the CVE is not listed in CISA KEV, so there is no evidence of active exploitation; the vuln.today decision label is 'this_week', consistent with a patch-available High that is not an active-exploitation emergency. A researcher write-up is referenced (x3r0day.github.io) alongside the oss-security disclosure and the upstream fix commit, indicating a public PoC reference exists though it is not verified as working exploit code. No SSVC decision string was provided to cross-check automatable/technical-impact. Note a scope subtlety: the attack vector is AV:L because the trigger file must be local, yet the realistic delivery path (cloning or extracting an untrusted repository/archive) makes this practically reachable for anyone who edits third-party code - defenders should weight that workflow rather than the raw 'local' label.

Exploit ScenarioDerived

An attacker publishes a repository or archive containing a crafted .dir-locals.el that registers a (REGEXP FUNCTION t) entry in auto-mode-alist. A developer clones or extracts it and opens a matching file in GNU Emacs 31.1, at which point Emacs invokes the attacker-supplied FUNCTION before set-auto-mode--dir-local-valid-p validates it, executing arbitrary Emacs Lisp with the user's privileges. A public PoC reference exists but is not verified as working exploit code; exploitation requires the local vector and the user action of opening the file (AV:L/UI:R).

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
No patch listed yet 0.2% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Nov 18, 2026

Arbitrary Emacs Lisp code execution in GNU Emacs 31.1 through the handling of directory-local variables: a crafted .dir-locals.el can register a (REGEXP FUNCTION t) entry in auto-mode-alist, and the named FUNCTION is invoked before set-auto-mode--dir-local-valid-p has a chance to validate it. Anyone who opens a matching file inside an attacker-supplied directory - typically after cloning or extracting an untrusted repository or archive - runs that Lisp with the privileges of their Emacs process, giving full confidentiality, integrity and availability impact under the assessed vector CVSS:3.1/AV:L/AC:L/PR:N/UI:R (7.8). The flaw is confined to 31.1 (30.2 is explicitly unaffected), exploitation requires local file presence plus a user opening a matching file, and no public exploit code is confirmed in the provided sources at time of analysis; the priority signal is 'this_week', reflecting a genuine but context-bound developer-workstation risk rather than a mass-exploitation emergency.

RemediationAI

Upstream fix is available as commit 205ae0b0583dbfe09e258164adbc49e130645221 in the GNU Emacs repository (https://cgit.git.savannah.gnu.org/cgit/emacs.git/commit/?id=205ae0b0583dbfe09e258164adbc49e130645221), which closes the validation gap; a released patched Emacs version number is not independently confirmed in the provided data, so confirm against the commit and the oss-security advisory (https://www.openwall.com/lists/oss-security/2026/11/11/7) and Debian bug 82213 (https://debbugs.gnu.org/82213) before relying on a specific tag, and updating to a build containing the fix is the remediation the evidence provides. Because exploitation is local and requires the victim to open a matching file in a directory holding an attacker-controlled .dir-locals.el, exposure is primarily through cloning or extracting untrusted repositories and archives into a directory tree that is then opened in Emacs 31.1; the sources supplied here do not describe a vendor-sanctioned workaround, safe-local-variable treatment or configuration change that fully substitutes for the fix.

Affected VersionsENISA

emacs 31.1

Affected Packages

euvd emacs no fix

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

Emacs implements per-project configuration through directory-local variables, stored in a .dir-locals.el file that Emacs evaluates/parses when files beneath that directory are visited. Among the variables such a file can set is auto-mode-alist, which maps filename regexps to major-mode activation functions; the (REGEXP FUNCTION t) form with a non-nil third element marks FUNCTION as the mode-setting function to be called for matching files. In 31.1 the call to that function happens before set-auto-mode--dir-local-valid-p performs its validation, so an attacker-controlled .dir-locals.el converts a routine 'open the file' action into Lisp execution. This is tracked as CWE-829 (inclusion of functionality from an untrusted control sphere): trusted configuration machinery is fed from an untrusted, repository-supplied file and the trust check is ordered incorrectly. The upstream project addressed the ordering/validation gap in commit 205ae0b0583dbfe09e258164adbc49e130645221 (referenced alongside the oss-security posting of 2026-11-11 and Debian bug 82213). The CVSS metrics describe severity, not mechanism: AV:L reflects that the malicious .dir-locals.el must already be on the local filesystem, UI:R reflects that nothing executes until a matching file is opened, and PR:N means no credentials on the target are required; the exact parsing/trigger details beyond the description above are not described in the available sources.

Know when Emacs gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (mitre) PRIMARY 7.8 HIGH
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
vuln.today AI 7.8 HIGH

Malicious file must be local (AV:L) and the user must open it (UI:R); no auth needed (PR:N), and arbitrary Lisp as the user yields full C:H/I:H/A:H within the unchanged scope.

3.1 AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
4.0 AV:L/AC:L/AT:N/PR:N/UI:P/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N

Primary rating from Vendor (mitre).

CVSS VectorVendor: mitre

Attack Vector
Local
Attack Complexity
Low
Privileges Required
None
User Interaction
Required
Scope
Unchanged
Confidentiality
High
Integrity
High
Availability
High

DescriptionCVE.org

GNU Emacs 31.1 contains a code injection vulnerability in its handling of directory-local variables. A crafted .dir-locals.el can supply a (REGEXP FUNCTION t) entry in auto-mode-alist; when a matching file is opened, Emacs calls FUNCTION before set-auto-mode--dir-local-valid-p validates it, executing arbitrary Emacs Lisp with the privileges of the Emacs process. (Emacs 30.2 is unaffected.)

Executive ViewAI

Why It Matters

A high-severity vulnerability in GNU Emacs 31.1 allows an attacker to execute arbitrary code on a developer's workstation when they open a file within a malicious directory, such as a cloned repository. This impacts the confidentiality, integrity, and availability of the affected system and could lead to data breaches or further compromise. Leadership should prioritize remediation for development teams using Emacs 31.1, as the risk is context-bound but potentially severe.

Business Impact: High
Compensating Controls

No vendor-released patch identified at time of analysis. Interim mitigations: set enable-dir-local-variables to nil in Emacs configuration, educate users to avoid opening untrusted repositories/archives, and consider using a sandboxed environment for Emacs.

Threat Intelligence Overview

EPSS Score
0.2%
Top 90% exploitable
Prevalence
Medium
popular developer editor, large but not universal production footprint
Social Media
2
Sightings
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.2%
Patch available No
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
None
System Exposure· derived
Small
Automatable
No
Human Impact
High
Technical Impact
Total

Priority Score

39
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +39
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.

More in Emacs

View all
CVE-2012-0035 CRITICAL
9.3 Jan 19

Untrusted search path vulnerability in EDE in CEDET before 1.0.1, as used in GNU Emacs before 23.4 and other products, a

CVE-2024-39331 CRITICAL
9.8 Jun 23

In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it specifies an unsafe

CVE-2017-14482 HIGH
8.8 Sep 14

GNU Emacs before 25.3 allows remote attackers to execute arbitrary code via email with crafted "Content-Type: text/enric

CVE-2024-53920 HIGH
7.8 Nov 27

In elisp-mode.el in GNU Emacs before 30.1, a user who chooses to invoke elisp-completion-at-point (for code completion)

CVE-2026-108976 HIGH
7.8 Oct 11

OS command injection in GNU Emacs's TRAMP remote-file library (Emacs releases before 31.2, TRAMP through 2.8.2) lets an

CVE-2026-96442 HIGH
7.8 Sep 23

Code execution in GNU Emacs versions prior to 31.2 occurs when Flymake performs on-the-fly syntax checking with a langua

CVE-2024-30202 HIGH
7.8 Mar 25

In Emacs before 29.3, arbitrary Lisp code is evaluated as part of turning on Org mode. Rated high severity (CVSS 7.8), t

CVE-2023-2491 HIGH
7.8 May 17

A flaw was found in the Emacs text editor. Rated high severity (CVSS 7.8), this vulnerability is low attack complexity.

CVE-2023-27986 HIGH
7.8 Mar 09

emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to Emacs Lisp code injections through a crafted mailto

CVE-2023-27985 HIGH
7.8 Mar 09

emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to shell command injections through a crafted mailto:

CVE-2022-45939 HIGH
7.8 Nov 28

GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file,

CVE-2014-9483 HIGH
7.5 Aug 28

Emacs 24.4 allows remote attackers to bypass security restrictions. Rated high severity (CVSS 7.5), this vulnerability i

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy