CVEfocus › CVE database › CVE-2026-131959

CVE-2026-131959

CVSS 7.8 HighEPSS 0.2% (higher than 6% of CVEs)Published 2026-11-18Updated 2026-11-18Assigner: mitre

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.)

CWE-829

What to do

Ubuntu has not shipped a fix for every release yet.

Is your server affected? One read-only command checks every installed package against this CVE and all others, using each vendor's fixed versions. Get started or get a free API key.

curl -sS "https://api.cvefocus.com/v1/check?format=text" -H "Authorization: Bearer $CVEFOCUS_KEY" \
  -H "Content-Type: text/plain" --data-binary @inventory.txt

Vendor status at a glance

15Fix pending
6Under investigation
26Not affected

Status by vendor and release

From each vendor's own security data and VEX statements. "Fixed" means a fixed build is published for that release.

ReleasePackageStatusFixed versionAdvisory
Ubuntu 26.10emacsFix pendingUBUNTU-CVE-2026-131959
Ubuntu 26.10xemacs21Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 26.10xemacs21-packagesFix pendingUBUNTU-CVE-2026-131959
Ubuntu 26.04emacsFix pendingUBUNTU-CVE-2026-131959
Ubuntu 26.04xemacs21Under investigationUBUNTU-CVE-2026-131959
Ubuntu 26.04xemacs21-packagesUnder investigationUBUNTU-CVE-2026-131959
Ubuntu 24.04emacsFix pendingUBUNTU-CVE-2026-131959
Ubuntu 24.04xemacs21Under investigationUBUNTU-CVE-2026-131959
Ubuntu 24.04xemacs21-packagesUnder investigationUBUNTU-CVE-2026-131959
Ubuntu 22.04emacsFix pendingUBUNTU-CVE-2026-131959
Ubuntu 22.04xemacs21Under investigationUBUNTU-CVE-2026-131959
Ubuntu 22.04xemacs21-packagesUnder investigationUBUNTU-CVE-2026-131959
Ubuntu 20.04emacsFix pendingUBUNTU-CVE-2026-131959
Ubuntu 20.04xemacs21Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 20.04xemacs21-packagesFix pendingUBUNTU-CVE-2026-131959
Ubuntu 18.04emacs25Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 18.04xemacs21Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 18.04xemacs21-packagesFix pendingUBUNTU-CVE-2026-131959
Ubuntu 16.04emacs24Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 16.04xemacs21Fix pendingUBUNTU-CVE-2026-131959
Ubuntu 16.04xemacs21-packagesFix pendingUBUNTU-CVE-2026-131959
Red Hat Enterprise Linux 10emacsNot affected
Red Hat Enterprise Linux 10emacs-commonNot affected
Red Hat Enterprise Linux 10emacs-filesystemNot affected
Red Hat Enterprise Linux 10emacs-lucidNot affected
Red Hat Enterprise Linux 10emacs-nwNot affected
Red Hat Enterprise Linux 9emacsNot affected
Red Hat Enterprise Linux 9emacs-commonNot affected
Red Hat Enterprise Linux 9emacs-filesystemNot affected
Red Hat Enterprise Linux 9emacs-lucidNot affected
Red Hat Enterprise Linux 9emacs-noxNot affected
Red Hat Enterprise Linux 8emacsNot affected
Red Hat Enterprise Linux 8emacs-commonNot affected
Red Hat Enterprise Linux 8emacs-filesystemNot affected
Red Hat Enterprise Linux 8emacs-lucidNot affected
Red Hat Enterprise Linux 8emacs-noxNot affected
Red Hat Enterprise Linux 8emacs-terminalNot affected
Red Hat Enterprise Linux 7emacsNot affected
Red Hat Enterprise Linux 7emacs-commonNot affected
Red Hat Enterprise Linux 7emacs-elNot affected
Red Hat Enterprise Linux 7emacs-filesystemNot affected
Red Hat Enterprise Linux 7emacs-noxNot affected
Red Hat Enterprise Linux 7emacs-terminalNot affected
Red Hat Enterprise Linux 6emacsNot affected
Red Hat Enterprise Linux 6emacs-commonNot affected
Red Hat Enterprise Linux 6emacs-elNot affected
Red Hat Enterprise Linux 6emacs-noxNot affected

What the vendor says

As published in the CVE record by mitre, the CVE's assigner (usually the vendor). Check the vendor's advisory before acting.

Solution: Apply the fix from commit 205ae0b0583dbfe09e258164adbc49e130645221 (emacs-31 branch), or upgrade to Emacs 31.2 or later when released.

Workaround: Do not open files in untrusted directories that contain a .dir-locals.el. Setting enable-dir-local-variables to nil disables directory-local variables.

References

About this page

Compiled by CVEfocus from the CVE List, the security data and VEX statements of Ubuntu, Debian, Red Hat, AlmaLinux, Rocky Linux and Microsoft, CISA's Known Exploited Vulnerabilities catalog and FIRST EPSS, refreshed several times a day (data status). Information only; see the disclaimer. Official record: cve.org · NVD.