GNU Emacs version 31.1 contains a code injection vulnerability related to its handling of directory-local variables. A maliciously crafted .dir-locals.el file can include a (REGEXP FUNCTION t) entry in auto-mode-alist that causes Emacs to execute arbitrary Emacs Lisp code with the privileges of the Emacs process when a matching file is opened. This vulnerability does not affect Emacs 30.2.