BSD Ports

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

· VuXML entry

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.

Affected versions

By system

2 still vulnerable, 2 fixed. Where VuXML applies (FreeBSD, DragonFly, FreeBSD's derivatives) a port is vulnerable while its version is in a range; pkgsrc says itself whether it lists a CVE of this advisory; OpenBSD and MidnightBSD keep no list this site reads, so their row is only an estimate: FreeBSD's ranges applied to upstream's version.

SystemPortVersionStateFixed
DragonFlyeditors/emacs31.1_3,3 vulnerable since 2026-11-16
OpenBSDeditors/emacs31.1-gtk3 out of range, by version
NetBSDeditors/emacs30.2 not listed
MidnightBSDeditors/emacs31.1_5,3 out of range, by version
FreeBSDeditors/emacs31.1_4,3 fixed
DragonFlyeditors/emacs-devel32.0.50.20260915,3 vulnerable since 2026-11-16
MidnightBSDeditors/emacs-devel31.0.50.20250515_4,3 in range, by version
FreeBSDeditors/emacs-devel32.0.50.20261115,3 fixed