CVE-2026-131959
7.8HighPublished 18 Nov 2026 · NVD status: Received · AI triage by gemini-3.1-flash-lite
High
0CVSS v3.110
- Attack vector
- Local
- Complexity
- Low
- Privileges
- None
- User action
- Required
- Impact
- Full C/I/A compromise
- Weakness
- CWE-829
What an attacker gets
Local attackers can execute arbitrary Emacs Lisp code with your user privileges. This requires a user to open a directory containing a malicious .dir-locals.el file.
Root cause
Emacs executes a function from the auto-mode-alist before validating it when processing directory-local variables.
Affected versions
GNU Emacs 31.1
CVSS v3.1 · CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Fix & remediation
Upgrade to a version later than 31.1 once available. Until then, disable directory-local variables by setting enable-dir-local-variables to nil in your init file.
$ emacs --versionAI-suggested. Run it in staging first and check it against the vendor advisory. Why?
NVD description
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.)