cve.bz

CVE-2026-131959 gnu emacs

7.8 highEPSS 0.2%

High (7.8) in gnu emacs. EPSS 0.2% estimated probability of exploitation activity in the next 30 days.

On this page
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.)

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.2% estimated probability of exploitation activity in the next 30 days; 7th percentile. Scored 2026-11-24. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: total, assessed 2026-11-18. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-829 Inclusion of Functionality from Untrusted Control Sphere
OWASP Top 10
A08:2025 Software or Data Integrity Failures
Published
Modified
Assigned by
mitre (CNA)
NVD analysis
Awaiting analysis
Record from
the NVD, synced

Ask an AI about this CVE

Show the promptExplain CVE-2026-131959 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2026-131959?via=ask-ai-copy and https://cve.bz/cve/CVE-2026-131959?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2026-131959 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
GNU Emacs31.1

Linux distributions

DistributionReleasePackageFixed inAdvisory
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 3 morexemacs21, xemacs21-packagesno fix listedUBUNTU-CVE-2026-131959
Ubuntu26.10emacs, xemacs21, xemacs21-packagesno fix listedUBUNTU-CVE-2026-131959
UbuntuPro:16.04:LTSemacs24no fix listedUBUNTU-CVE-2026-131959
UbuntuPro:18.04:LTSemacs25no fix listedUBUNTU-CVE-2026-131959
UbuntuPro:20.04:LTS, Pro:22.04:LTS, Pro:24.04:LTS and 1 moreemacsno fix listedUBUNTU-CVE-2026-131959

From the distributions' data via OSV.dev: Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Ubuntu.

Red Hat

Red Hat rates this Important.

Red Hat's statement

To exploit this issue, a user needs to open a file within an untrusted directory, such as a cloned Git repository or extracted archive, that contains a malicious .dir-locals.el file, limiting its exposure and requiring user interaction. However, successful exploitation can allow execution of arbitrary Emacs Lisp code with the privileges of the Emacs process, potentially leading to a system compromise. For these reasons, this vulnerability has been rated with an important severity.

Red Hat's mitigation

To mitigate this flaw, disable directory-local variable processing in Emacs configuration:

Add the following configuration setting to the user initialization file (`~/.emacs`, `~/.emacs.el`, or `~/.emacs.d/init.el`), or globally across the system in the site initialization file (such as `/etc/emacs/site-start.el`):

```elisp

(setq enable-dir-local-variables nil)

```

Running Emacs instances must be restarted for the configuration change to take effect.

Caveats: Disabling this setting prevents Emacs from automatically loading project-specific and directory-level customization files.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 10emacsNot affected
Red Hat Enterprise Linux 6emacsNot affected
Red Hat Enterprise Linux 7emacsNot affected
Red Hat Enterprise Linux 8emacsNot affected
Red Hat Enterprise Linux 9emacsNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2026-131959.

Attack patterns (CAPEC)

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits. More on the page of CWE-829 (13).

References

Check your stackJSON