Read the docs

Code injection in GNU Emacs directory-local variable handling

Priority LOW 35CWE-829Published · Updated

Key facts

Attack vector
Local
Privileges required
None
User interaction
Required
Attack complexity
Low
Impact type
Code execution
Confidentiality · integrity · availability
High · High · High
Fix status
No fix listed

Attack profile from CVSS 3.1 · CNA. Fix status from CNA. Impact type from CWE-829.

Summary

GNU Emacs 31.1 contains a code injection flaw in how it handles directory-local variables, classified as CWE-829. A crafted .dir-locals.el can register a function that Emacs calls before validating it, running arbitrary Emacs Lisp with the privileges of the Emacs process. A local attacker who can place such a file needs a user to open a matching file. Emacs 30.2 is unaffected.

Written with Claude Haiku 5.5 from the sources below · 2026-11-18

Description from the CNA

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

Why it matters now

Exploitation None reported CISA SSVC · not in CISA KEV
EPSS 0.00201 5th percentileScored 2026-11-30
Fix No fix listed No fixed version in the sources yet

SSVC decision points

CISA ADP · SSVC 2.0.3

Exploitation
None
Automatable
No
Technical impact
Total

The decision (Track, Attend, Act) also depends on your mission and well-being impact; see CISA's SSVC guide.

Affected products

VendorProductAffected versionsFixed inStatusSource
GNUEmacs31.1—No fix listedCNA
  • Emacs VendorGNU Affected 31.1 Fixed in — No fix listed CNA

Remediation

The sources list no fixed version for GNU Emacs. Emacs 30.2 is unaffected.

Written with Claude Haiku 5.5 from the sources below · 2026-11-18

Vendor assessments

Red Hat

Red Hat rating: Important. Red Hat's page for this CVE →

Not affected: 5 products
  • Red Hat Enterprise Linux 10
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9

Timeline

  1. 2026-11-18 Threatist record created from CVE-2026-131959
  2. 2026-11-18 Alias added: GHSA-5hqm-5j9g-jhcr
  3. 2026-11-18 CISA SSVC decision points changed
  4. 2026-11-18 Affected versions changed · Red Hat
  5. 2026-11-18 CVSS score added · Red Hat

References

  • TI-2026-19388 Authentication bypass in GNU Inetutils telnetd via USER variable KEVCVSS 3.1CRITICAL 9.8
  • TI-2014-05975 GNU Bash environment variable parsing flaw lets attackers write files KEVCVSS 3.1CRITICAL 9.8
  • TI-2014-05157 Code execution in GNU Bash through crafted environment variables KEVCVSS 3.1CRITICAL 9.8
  • TI-2014-05164 Command injection in GNU Bash via crafted environment variables KEVCVSS 3.1HIGH 8.8
  • TI-2023-04522 Buffer overflow in glibc ld.so allows privilege escalation KEVCVSS 3.1HIGH 7.8
  • TI-2009-03392 The TLS protocol, and the SSL protocol 3.0 and possibly earlier, as used in Microsoft… CVSS 3.1CRITICAL 9.8
See all 1287 →

Sources