FreeBSD VuXML: Documenting security issues in FreeBSD and the FreeBSD Ports Collection

Emacs -- Arbitrary code execution via .dir-locals.el

Affected packages
emacs < 31.1_4,3
emacs-canna < 31.1_4,3
emacs-nox < 31.1_4,3
emacs-wayland < 31.1_4,3
emacs-devel < 32.0.50.20261115,3
emacs-devel-nox < 32.0.50.20261115,3

Details

VuXML ID 05eaad8b-e202-11f1-85bb-1c697a616631
Discovery 2026-11-10
Entry 2026-11-16

Problem Description

Emacs validates the major modes named in the auto-mode-alist of a .dir-locals.el before calling them. Functions in entries of the form (REGEXP FUNCTION t) were called without this validation.

Impact

Visiting a file in a directory tree containing a crafted .dir-locals.el can execute arbitrary Lisp code with the privileges of the user running Emacs.

References

URL https://debbugs.gnu.org/82213
URL https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=205ae0b0583dbfe09e258164adbc49e130645221
URL https://www.openwall.com/lists/oss-security/2026/11/11/7