Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2024-30202 Overview
CVE-2024-30202 is a code injection vulnerability [CWE-94] affecting GNU Emacs before 29.3 and Org Mode before 9.6.23. When a user opens a file that activates Org mode, arbitrary Lisp code embedded in the file is evaluated during initialization. An attacker who delivers a crafted .org file can achieve local code execution in the context of the user running Emacs.
Critical Impact
Opening a malicious Org file in a vulnerable Emacs release triggers evaluation of attacker-controlled Lisp code, resulting in full compromise of the user session.
Affected Products
- GNU Emacs versions prior to 29.3
- GNU Org Mode versions prior to 9.6.23
- Distributions and packages bundling vulnerable Emacs or Org Mode builds
Discovery Timeline
- 2024-03-25 - CVE-2024-30202 published to NVD
- 2026-06-17 - Last updated in NVD database
Technical Details for CVE-2024-30202
Vulnerability Analysis
The flaw resides in the activation path for Org mode. When Emacs opens a file matching the Org major mode, initialization logic processes in-file settings and local variables. The vulnerable code path evaluates Lisp expressions sourced from the file content without adequate restriction. A crafted document can therefore execute arbitrary Emacs Lisp as soon as the user visits it. Because Emacs Lisp can invoke shell commands and manipulate the file system, the result is arbitrary code execution with the privileges of the Emacs process.
The issue is tracked as a code injection weakness [CWE-94]. Exploitation does not require network access; the attack vector is local, and user interaction consists of opening the malicious file.
Root Cause
The root cause is unsafe evaluation of Lisp forms during Org mode activation. The initialization sequence treats file-supplied values as trusted and passes them to eval without sandboxing or user confirmation. Patches in commits befa9fcaae29a6c9a283ba371c3c5234c7f644eb (Emacs) and 003ddacf1c8d869b1858181c29ea21b731a8d8d9 (Org Mode) remove or constrain this evaluation path.
Attack Vector
An attacker distributes a weaponized .org file through email, chat, source repositories, or shared storage. When the target opens the file in a vulnerable Emacs build, Org mode activates and evaluates the embedded Lisp. The payload runs as the local user and can establish persistence, exfiltrate data, or pivot to other processes.
No authentication to a remote service is required. Exploitation depends solely on local file access and the user action of visiting the file. See the GNU Emacs Commit Update and GNU Org-Mode Commit Update for the specific code paths removed by the fix.
Stop Remote Code Execution Before It Runs
Singularity™ Endpoint detects and blocks exploit attempts at machine speed, including zero-days and novel attack techniques.
Stop Exploit AttemptsDetection Methods for CVE-2024-30202
Indicators of Compromise
- Unexpected child processes spawned by the emacs binary, especially shells, network utilities, or scripting interpreters.
- Newly created or modified files in ~/.emacs.d/ or user init files following the opening of an Org document.
- Outbound network connections initiated by Emacs to unfamiliar hosts shortly after a file-open event.
- .org files containing suspicious #+STARTUP, #+BIND, or file-local variable blocks referencing shell execution or eval forms.
Detection Strategies
- Inventory installed Emacs and Org Mode versions across developer and server endpoints, flagging builds below 29.3 and 9.6.23.
- Monitor process ancestry for emacs parent processes launching sh, bash, curl, wget, python, or perl.
- Alert on Emacs processes writing to autostart locations, cron files, or SSH key directories.
Monitoring Recommendations
- Enable endpoint telemetry on developer workstations, which are the primary population running Emacs.
- Collect file-open and process-creation events into a SIEM for correlation with Org file delivery vectors such as mail gateways and Git pulls.
- Track egress traffic from editor processes against a baseline of expected update and package endpoints.
How to Mitigate CVE-2024-30202
Immediate Actions Required
- Upgrade GNU Emacs to version 29.3 or later on all endpoints and build systems.
- Upgrade standalone Org Mode packages to version 9.6.23 or later where installed independently of Emacs.
- Audit shared repositories and mail archives for untrusted .org files received before the patch date.
- Instruct users not to open Org files from untrusted sources until patching is complete.
Patch Information
The vendor fixes are available in the upstream repositories. Emacs 29.3 includes commit befa9fcaae29a6c9a283ba371c3c5234c7f644eb, and Org Mode 9.6.23 includes commit 003ddacf1c8d869b1858181c29ea21b731a8d8d9. Distribution-specific updates are tracked in the OpenWall OSS Security Update and the GNU Emacs News File.
Workarounds
- Set enable-local-variables to nil or :safe to block evaluation of file-local variables when opening untrusted documents.
- Disable automatic Org mode activation for files sourced from untrusted locations by removing the mode association until the patch is applied.
- Review and restrict org-startup-with-* and #+BIND handling via administrator-managed init configuration.
# Configuration example: harden Emacs init against untrusted file-local variables
echo '(setq enable-local-variables :safe)' >> ~/.emacs.d/init.el
echo '(setq enable-local-eval nil)' >> ~/.emacs.d/init.el
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

