Local Security Bug in GNU Emacs

Nov 05, 2007

A vulnerability in the extended text editor GNU Emacs gives local attackers the ability to run arbitrary code.

Developer Drake Wilson disclosed the vulnerability on the Debian Security mailing list. The error is caused by incorrect behavior of the "hack-local-variables" function if it is set to ":safe". The documentation for the function states that Emacs only runs variables that are declared as safe in this case, but this is not true: Emacs actually ignores the function and uses any local variable. An attacker could exploit this to modify the current user’s init file and execute code by means of a carefully crafted Emacs Lisp file.

The bug affects Emacs version 22.1 and possibly others. The Emacs 22.1 package in the Debian Etch repository does not have the bug says another developer. A fix is available from the CVS repository. The vulnerability has been assigned CVE ID CVE-2007-5795. The GNU Emacs maintainer has been notified.

Related content

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News