Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessPlant crafted .dir-locals.el in repo or archive
-
ExploitVictim opens matching file in Emacs 31.1
-
Executionauto-mode-alist FUNCTION invoked before validation
-
ImpactArbitrary 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). |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – 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
Affected Packages
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
AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
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.
Primary rating from Vendor (mitre).
CVSS VectorVendor: mitre
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
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.
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
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.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Remote Code Execution represents the critical moment when an attacker successfully runs arbitrary code on a target system without physical access.
Untrusted search path vulnerability in EDE in CEDET before 1.0.1, as used in GNU Emacs before 23.4 and other products, a
In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it specifies an unsafe
GNU Emacs before 25.3 allows remote attackers to execute arbitrary code via email with crafted "Content-Type: text/enric
In elisp-mode.el in GNU Emacs before 30.1, a user who chooses to invoke elisp-completion-at-point (for code completion)
OS command injection in GNU Emacs's TRAMP remote-file library (Emacs releases before 31.2, TRAMP through 2.8.2) lets an
Code execution in GNU Emacs versions prior to 31.2 occurs when Flymake performs on-the-fly syntax checking with a langua
In Emacs before 29.3, arbitrary Lisp code is evaluated as part of turning on Org mode. Rated high severity (CVSS 7.8), t
A flaw was found in the Emacs text editor. Rated high severity (CVSS 7.8), this vulnerability is low attack complexity.
emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to Emacs Lisp code injections through a crafted mailto
emacsclient-mail.desktop in Emacs 28.1 through 28.2 is vulnerable to shell command injections through a crafted mailto:
GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file,
Emacs 24.4 allows remote attackers to bypass security restrictions. Rated high severity (CVSS 7.5), this vulnerability i
EUVD-2026-128466
GHSA-5hqm-5j9g-jhcr
NVD
CVE.org
EPSS
Vulnrichment
VulDB
Exploit-DB