Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 253985 - app-editors/emacs, app-editors/emacs-cvs "file local variables" denial-of-service attack
Summary: app-editors/emacs, app-editors/emacs-cvs "file local variables" denial-of-ser...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Emacs project
URL: http://thread.gmane.org/gmane.emacs.d...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-06 15:58 UTC by Ulrich Müller
Modified: 2009-04-29 05:28 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2009-01-06 15:58:58 UTC
The Lisp reader syntax in recent Emacs versions allows for circular objects.
This can be exploited for a denial-of-service attack (remove the "*" from the word "Variables" below to enable it):

$ cat testfile
Local Variab*les:
byte-compile-warnings: #1=("circular" "object" . #1#)
End:
$ emacs -Q testfile

Now Emacs will hang and consume all CPU time.

Variant of the attack (requires emacs-cvs for the "--daemon" option):
$ emacs -Q --daemon
$ emacsclient testfile

Again, Emacs will hang and consume CPU time, and as far as I can see there is no way to regain control.

Similar attacks are also possible for variables "epa-file-encrypt-to", "tex-verbatim-environments", and maybe others, too. These variables have in common that their "save-local-variable" properties point to custom functions that check for a valid value of the respective variable. If that value is a list, the functions try to verify each element, which will fail if the list contains circular structures.

Affected by the problem are app-editors/emacs >=22 and app-editors/emacs-cvs.

I haven't reported the issue upstream yet.
Comment 1 Ulrich Müller gentoo-dev 2009-01-06 16:06:49 UTC
> These variables have in common that their "save-local-variable" properties
> point to custom functions

Correction: The property is called "safe-local-variable" (not "save").
Comment 2 Ulrich Müller gentoo-dev 2009-01-09 17:14:33 UTC
Reassigning to Emacs team, since it is a user assisted DOS attack, and neither rbu nor upstream consider this as security issue.
Comment 3 Robert Buchholz (RETIRED) gentoo-dev 2009-01-09 17:16:13 UTC
public via http://thread.gmane.org/gmane.emacs.devel/107726
Comment 4 Ulrich Müller gentoo-dev 2009-04-29 05:26:55 UTC
 
Comment 5 Ulrich Müller gentoo-dev 2009-04-29 05:28:48 UTC
Fixed in CVS upstream.