Join the Cyber Forum: Threat Intel on May 12, 2026 to learn how AI is reshaping threat defense.Join the Virtual Cyber Forum: Threat IntelRegister Now
Experiencing a Breach?Blog
Get StartedContact Us
SentinelOne
  • Platform
    Platform Overview
    • Singularity Platform
      Welcome to Integrated Enterprise Security
    • AI for Security
      Leading the Way in AI-Powered Security Solutions
    • Securing AI
      Accelerate AI Adoption with Secure AI Tools, Apps, and Agents.
    • How It Works
      The Singularity XDR Difference
    • Singularity Marketplace
      One-Click Integrations to Unlock the Power of XDR
    • Pricing & Packaging
      Comparisons and Guidance at a Glance
    Data & AI
    • Purple AI
      Accelerate SecOps with Generative AI
    • Singularity Hyperautomation
      Easily Automate Security Processes
    • AI-SIEM
      The AI SIEM for the Autonomous SOC
    • AI Data Pipelines
      Security Data Pipeline for AI SIEM and Data Optimization
    • Singularity Data Lake
      AI-Powered, Unified Data Lake
    • Singularity Data Lake for Log Analytics
      Seamlessly Ingest Data from On-Prem, Cloud or Hybrid Environments
    Endpoint Security
    • Singularity Endpoint
      Autonomous Prevention, Detection, and Response
    • Singularity XDR
      Native & Open Protection, Detection, and Response
    • Singularity RemoteOps Forensics
      Orchestrate Forensics at Scale
    • Singularity Threat Intelligence
      Comprehensive Adversary Intelligence
    • Singularity Vulnerability Management
      Application & OS Vulnerability Management
    • Singularity Identity
      Identity Threat Detection and Response
    Cloud Security
    • Singularity Cloud Security
      Block Attacks with an AI-Powered CNAPP
    • Singularity Cloud Native Security
      Secure Cloud and Development Resources
    • Singularity Cloud Workload Security
      Real-Time Cloud Workload Protection Platform
    • Singularity Cloud Data Security
      AI-Powered Threat Detection for Cloud Storage
    • Singularity Cloud Security Posture Management
      Detect and Remediate Cloud Misconfigurations
    Securing AI
    • Prompt Security
      Secure AI Tools Across Your Enterprise
  • Why SentinelOne?
    Why SentinelOne?
    • Why SentinelOne?
      Cybersecurity Built for What’s Next
    • Our Customers
      Trusted by the World’s Leading Enterprises
    • Industry Recognition
      Tested and Proven by the Experts
    • About Us
      The Industry Leader in Autonomous Cybersecurity
    Compare SentinelOne
    • Arctic Wolf
    • Broadcom
    • CrowdStrike
    • Cybereason
    • Microsoft
    • Palo Alto Networks
    • Sophos
    • Splunk
    • Trellix
    • Trend Micro
    • Wiz
    Verticals
    • Energy
    • Federal Government
    • Finance
    • Healthcare
    • Higher Education
    • K-12 Education
    • Manufacturing
    • Retail
    • State and Local Government
  • Services
    Managed Services
    • Managed Services Overview
      Wayfinder Threat Detection & Response
    • Threat Hunting
      World-Class Expertise and Threat Intelligence
    • Managed Detection & Response
      24/7/365 Expert MDR Across Your Entire Environment
    • Incident Readiness & Response
      DFIR, Breach Readiness, & Compromise Assessments
    Support, Deployment, & Health
    • Technical Account Management
      Customer Success with Personalized Service
    • SentinelOne GO
      Guided Onboarding & Deployment Advisory
    • SentinelOne University
      Live and On-Demand Training
    • Services Overview
      Comprehensive Solutions for Seamless Security Operations
    • SentinelOne Community
      Community Login
  • Partners
    Our Network
    • MSSP Partners
      Succeed Faster with SentinelOne
    • Singularity Marketplace
      Extend the Power of S1 Technology
    • Cyber Risk Partners
      Enlist Pro Response and Advisory Teams
    • Technology Alliances
      Integrated, Enterprise-Scale Solutions
    • SentinelOne for AWS
      Hosted in AWS Regions Around the World
    • Channel Partners
      Deliver the Right Solutions, Together
    • SentinelOne for Google Cloud
      Unified, Autonomous Security Giving Defenders the Advantage at Global Scale
    • Partner Locator
      Your Go-to Source for Our Top Partners in Your Region
    Partner Portal→
  • Resources
    Resource Center
    • Case Studies
    • Data Sheets
    • eBooks
    • Reports
    • Videos
    • Webinars
    • Whitepapers
    • Events
    View All Resources→
    Blog
    • Feature Spotlight
    • For CISO/CIO
    • From the Front Lines
    • Identity
    • Cloud
    • macOS
    • SentinelOne Blog
    Blog→
    Tech Resources
    • SentinelLABS
    • Ransomware Anthology
    • Cybersecurity 101
  • About
    About SentinelOne
    • About SentinelOne
      The Industry Leader in Cybersecurity
    • Investor Relations
      Financial Information & Events
    • SentinelLABS
      Threat Research for the Modern Threat Hunter
    • Careers
      The Latest Job Opportunities
    • Press & News
      Company Announcements
    • Cybersecurity Blog
      The Latest Cybersecurity Threats, News, & More
    • FAQ
      Get Answers to Our Most Frequently Asked Questions
    • DataSet
      The Live Data Platform
    • S Foundation
      Securing a Safer Future for All
    • S Ventures
      Investing in the Next Generation of Security, Data and AI
  • Pricing
Get StartedContact Us
CVE Vulnerability Database
Vulnerability Database/CVE-2024-39331

CVE-2024-39331: GNU Emacs Org Mode RCE Vulnerability

CVE-2024-39331 is a remote code execution vulnerability in GNU Emacs Org Mode that allows unsafe function execution through link abbrevs. This article covers the technical details, affected versions, and mitigation steps.

Updated: January 22, 2026

CVE-2024-39331 Overview

CVE-2024-39331 is a critical code injection vulnerability affecting GNU Emacs before version 29.4 and Org Mode before version 9.7.5. The vulnerability exists in the org-link-expand-abbrev function within lisp/ol.el, which expands %(...) link abbreviations even when they specify unsafe functions such as shell-command-to-string. This allows attackers to execute arbitrary shell commands when a user interacts with a specially crafted Org Mode document containing malicious link abbreviations.

Critical Impact

This vulnerability enables arbitrary code execution on systems running vulnerable versions of GNU Emacs with Org Mode. An attacker can craft malicious Org files that execute system commands when link abbreviations are expanded, potentially leading to complete system compromise.

Affected Products

  • GNU Emacs versions before 29.4
  • Org Mode versions before 9.7.5
  • Debian and other Linux distributions packaging vulnerable Emacs versions

Discovery Timeline

  • June 23, 2024 - CVE-2024-39331 published to NVD
  • April 30, 2025 - Last updated in NVD database

Technical Details for CVE-2024-39331

Vulnerability Analysis

The vulnerability resides in Emacs' Org Mode, specifically within the link abbreviation expansion mechanism. Org Mode supports link abbreviations that allow users to define shorthand notation for commonly used URLs or paths. These abbreviations can include dynamic components using the %(...) syntax, which evaluates Emacs Lisp expressions.

The critical flaw is that org-link-expand-abbrev in lisp/ol.el does not properly validate or restrict which functions can be invoked through this expansion mechanism. This allows dangerous functions like shell-command-to-string to be called, enabling arbitrary command execution. When a user opens or processes an Org file containing a malicious link abbreviation, the embedded shell commands execute with the privileges of the Emacs process.

The vulnerability is classified under CWE-94 (Improper Control of Generation of Code - Code Injection), reflecting the core issue of uncontrolled code execution through user-supplied input.

Root Cause

The root cause is insufficient input validation in the link abbreviation expansion logic. The org-link-expand-abbrev function processes %(...) expressions without restricting them to safe functions. Any Emacs Lisp function, including those that interact with the operating system shell, can be invoked through this mechanism.

The fix implemented in the security patch adds proper validation to ensure that only safe, authorized functions can be called during link abbreviation expansion, preventing arbitrary code execution through malicious Org documents.

Attack Vector

An attacker exploits this vulnerability by crafting a malicious Org Mode document containing specially constructed link abbreviations. The attack vector is network-based, as these malicious documents can be distributed via email attachments, version control repositories, or any file-sharing mechanism.

When a victim opens the malicious Org file in Emacs, the link abbreviation containing the %(shell-command-to-string ...) construct is processed. This triggers command execution without explicit user consent beyond opening the file.

The exploitation requires no authentication and minimal user interaction—simply viewing or processing the malicious Org document is sufficient to trigger the vulnerability.

Detection Methods for CVE-2024-39331

Indicators of Compromise

  • Org Mode files containing suspicious %(...) expressions with shell-command-to-string or similar unsafe functions
  • Unexpected child processes spawned by Emacs processes
  • Unusual network connections originating from Emacs
  • Evidence of shell command execution in Emacs-related logs or process trees

Detection Strategies

  • Monitor file system access for Org files containing %(shell-command-to-string patterns
  • Implement endpoint detection rules for Emacs spawning unexpected shell processes
  • Deploy static analysis tools to scan Org files for potentially malicious link abbreviations
  • Use behavioral analysis to detect anomalous process execution chains starting from Emacs

Monitoring Recommendations

  • Audit all incoming Org Mode files in email gateways and file sharing systems
  • Enable process monitoring for Emacs instances in enterprise environments
  • Configure SIEM rules to alert on suspicious Emacs process behavior
  • Review version control commits for Org files with potentially malicious content

How to Mitigate CVE-2024-39331

Immediate Actions Required

  • Upgrade GNU Emacs to version 29.4 or later immediately
  • Update Org Mode to version 9.7.5 or later if using a standalone installation
  • Avoid opening untrusted Org Mode files until systems are patched
  • Review and audit any Org files from external sources before opening

Patch Information

GNU has released security patches addressing this vulnerability. The fix is available in GNU Emacs 29.4 and Org Mode 9.7.5. The specific commit addressing this issue can be found in the Emacs Org-Mode Commit. Debian has also released security advisories for affected packages as documented in their LTS announcements.

For additional information, refer to the GNU Emacs Release Notes and the GNU Emacs Info Update.

Workarounds

  • Disable automatic processing of link abbreviations by customizing Emacs configuration
  • Implement organizational policies prohibiting opening Org files from untrusted sources
  • Use sandboxed environments when working with potentially malicious documents
  • Consider using file-level access controls to restrict which Org files can be opened
bash
# Verify Emacs version to confirm patched status
emacs --version

# Update Emacs on Debian/Ubuntu systems
sudo apt update && sudo apt upgrade emacs

# Update Org Mode via MELPA (if using package manager)
# M-x package-refresh-contents
# M-x package-upgrade org

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

  • Vulnerability Details
  • TypeRCE

  • Vendor/TechGnu Emacs

  • SeverityCRITICAL

  • CVSS Score9.8

  • EPSS Probability0.41%

  • Known ExploitedNo
  • CVSS Vector
  • CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
  • Impact Assessment
  • ConfidentialityLow
  • IntegrityNone
  • AvailabilityHigh
  • CWE References
  • CWE-94
  • Technical References
  • GNU Emacs Release Notes

  • Org Mode Mailing List Post

  • Debian LTS Advisory #2024-06-23

  • Debian LTS Advisory #2024-06-24

  • GNU Emacs Info Update

  • Hacker News Discussion

  • Openwall OSS-Security Post 1

  • Openwall OSS-Security Post 2
  • Vendor Resources
  • Emacs Org-Mode Commit
  • Related CVEs
  • CVE-2024-53920: GNU Emacs RCE Vulnerability

  • CVE-2022-45939: GNU Emacs Command Injection Vulnerability

  • CVE-2026-6861: GNU Emacs Memory Corruption DoS Vulnerability
Default Legacy - Prefooter | Experience the World’s Most Advanced Cybersecurity Platform

Experience the World’s Most Advanced Cybersecurity Platform

See how our intelligent, autonomous cybersecurity platform can protect your organization now and into the future.

Try SentinelOne
  • Get Started
  • Get a Demo
  • Product Tour
  • Why SentinelOne
  • Pricing & Packaging
  • FAQ
  • Contact
  • Contact Us
  • Customer Support
  • SentinelOne Status
  • Language
  • Platform
  • Singularity Platform
  • Singularity Endpoint
  • Singularity Cloud
  • Singularity AI-SIEM
  • Singularity Identity
  • Singularity Marketplace
  • Purple AI
  • Services
  • Wayfinder TDR
  • SentinelOne GO
  • Technical Account Management
  • Support Services
  • Verticals
  • Energy
  • Federal Government
  • Finance
  • Healthcare
  • Higher Education
  • K-12 Education
  • Manufacturing
  • Retail
  • State and Local Government
  • Cybersecurity for SMB
  • Resources
  • Blog
  • Labs
  • Case Studies
  • Videos
  • Product Tours
  • Events
  • Cybersecurity 101
  • eBooks
  • Webinars
  • Whitepapers
  • Press
  • News
  • Ransomware Anthology
  • Company
  • About Us
  • Our Customers
  • Careers
  • Partners
  • Legal & Compliance
  • Security & Compliance
  • Investor Relations
  • S Foundation
  • S Ventures

©2026 SentinelOne, All Rights Reserved.

Privacy Notice Terms of Use

English