CVE-2026-131959: Code Injection

Published Nov 18, 2026
·
Updated

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

Affected Software

1 affected component
GNU Emacs=31.1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Fixed in 31.2

Event History

Nov 18, 2026
CVE Published
via MITRE·07:34 AM
Data Sourced
via MITRE·07:34 AM
RemedyDescriptionSeverityWeakness
Data Sourced
via NVD·08:17 AM
DescriptionSeverityWeakness

Frequently Asked Questions

1

Who is exposed to exploitation?

Users of GNU Emacs 31.1 are exposed when they open a file whose directory hierarchy contains a crafted .dir-locals.el and the file matches the attacker-supplied auto-mode-alist regular expression. Emacs 30.2 is identified as unaffected.

2

What must an attacker provide for exploitation to occur?

The attacker needs to place or cause the user to use a crafted .dir-locals.el containing a (REGEXP FUNCTION t) auto-mode-alist entry, along with a file that matches REGEXP. Exploitation requires the user to open that matching file.

3

What is the impact if exploitation succeeds?

The crafted function can execute arbitrary Emacs Lisp with the privileges of the Emacs process. This can affect confidentiality, integrity, and availability at that privilege level.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203