CVE-2024-39331: n/a
In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it specifies an unsafe function, such as shell-command-to-string. This affects Org Mode before 9.7.5.
AI Analysis
Technical Summary
CVE-2024-39331 is a critical vulnerability identified in the Emacs text editor, affecting versions prior to 29.4 and specifically impacting Org Mode versions before 9.7.5. The vulnerability arises from the org-link-expand-abbrev function located in the lisp/ol.el file, which is responsible for expanding link abbreviations in Org Mode documents. This function improperly processes %(...) link abbreviations, allowing the execution of unsafe functions such as shell-command-to-string. This flaw enables an attacker to craft malicious Org Mode files containing specially formatted links that, when opened by a vulnerable Emacs instance, execute arbitrary shell commands on the host system. The vulnerability requires no authentication or user interaction, making it remotely exploitable over any vector that delivers malicious Org files. The CVSS 3.1 base score of 9.8 reflects the high impact on confidentiality, integrity, and availability, as arbitrary code execution can lead to full system compromise. The underlying weakness is classified under CWE-94 (Improper Control of Generation of Code), indicating that the application fails to safely handle dynamic code execution. Although no known exploits have been reported in the wild, the vulnerability's nature and severity necessitate urgent attention from users and administrators of affected Emacs versions. The absence of patch links in the provided data suggests that users should monitor official Emacs and Org Mode repositories for updates or apply available security advisories promptly.
Potential Impact
The impact of CVE-2024-39331 is severe for organizations worldwide using vulnerable Emacs versions with Org Mode. Successful exploitation allows remote attackers to execute arbitrary shell commands without authentication or user interaction, potentially leading to full system compromise. This can result in unauthorized data access, data modification or destruction, installation of persistent malware, lateral movement within networks, and disruption of critical services. Organizations relying on Emacs for development, documentation, or automation workflows may face operational downtime and data breaches. The vulnerability also poses risks to supply chain security if malicious Org files are distributed via shared repositories or collaboration platforms. Given Emacs's widespread use in academia, research, software development, and certain government agencies, the threat extends across multiple sectors. The critical severity and ease of exploitation underscore the urgency for mitigation to prevent exploitation and protect organizational assets.
Mitigation Recommendations
1. Upgrade Emacs to version 29.4 or later and Org Mode to version 9.7.5 or later as soon as official patches are available. 2. Until patches are applied, restrict the opening of Org files from untrusted or unknown sources to prevent malicious code execution. 3. Implement strict access controls and user permissions to limit who can run Emacs and open Org files, reducing the attack surface. 4. Employ application whitelisting or sandboxing techniques to contain potential exploitation within Emacs processes. 5. Monitor system logs and command execution traces for unusual activity indicative of exploitation attempts, such as unexpected shell commands spawned by Emacs. 6. Educate users about the risks of opening unverified Org files and encourage safe handling practices. 7. Consider disabling or restricting the use of org-link-expand-abbrev or related dynamic link expansion features if feasible in the short term. 8. Maintain updated backups and incident response plans to quickly recover from potential compromises.
Affected Countries
United States, Germany, France, United Kingdom, Canada, Japan, South Korea, India, Australia, Netherlands
CVE-2024-39331: n/a
Description
In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it specifies an unsafe function, such as shell-command-to-string. This affects Org Mode before 9.7.5.
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
CVE-2024-39331 is a critical vulnerability identified in the Emacs text editor, affecting versions prior to 29.4 and specifically impacting Org Mode versions before 9.7.5. The vulnerability arises from the org-link-expand-abbrev function located in the lisp/ol.el file, which is responsible for expanding link abbreviations in Org Mode documents. This function improperly processes %(...) link abbreviations, allowing the execution of unsafe functions such as shell-command-to-string. This flaw enables an attacker to craft malicious Org Mode files containing specially formatted links that, when opened by a vulnerable Emacs instance, execute arbitrary shell commands on the host system. The vulnerability requires no authentication or user interaction, making it remotely exploitable over any vector that delivers malicious Org files. The CVSS 3.1 base score of 9.8 reflects the high impact on confidentiality, integrity, and availability, as arbitrary code execution can lead to full system compromise. The underlying weakness is classified under CWE-94 (Improper Control of Generation of Code), indicating that the application fails to safely handle dynamic code execution. Although no known exploits have been reported in the wild, the vulnerability's nature and severity necessitate urgent attention from users and administrators of affected Emacs versions. The absence of patch links in the provided data suggests that users should monitor official Emacs and Org Mode repositories for updates or apply available security advisories promptly.
Potential Impact
The impact of CVE-2024-39331 is severe for organizations worldwide using vulnerable Emacs versions with Org Mode. Successful exploitation allows remote attackers to execute arbitrary shell commands without authentication or user interaction, potentially leading to full system compromise. This can result in unauthorized data access, data modification or destruction, installation of persistent malware, lateral movement within networks, and disruption of critical services. Organizations relying on Emacs for development, documentation, or automation workflows may face operational downtime and data breaches. The vulnerability also poses risks to supply chain security if malicious Org files are distributed via shared repositories or collaboration platforms. Given Emacs's widespread use in academia, research, software development, and certain government agencies, the threat extends across multiple sectors. The critical severity and ease of exploitation underscore the urgency for mitigation to prevent exploitation and protect organizational assets.
Mitigation Recommendations
1. Upgrade Emacs to version 29.4 or later and Org Mode to version 9.7.5 or later as soon as official patches are available. 2. Until patches are applied, restrict the opening of Org files from untrusted or unknown sources to prevent malicious code execution. 3. Implement strict access controls and user permissions to limit who can run Emacs and open Org files, reducing the attack surface. 4. Employ application whitelisting or sandboxing techniques to contain potential exploitation within Emacs processes. 5. Monitor system logs and command execution traces for unusual activity indicative of exploitation attempts, such as unexpected shell commands spawned by Emacs. 6. Educate users about the risks of opening unverified Org files and encourage safe handling practices. 7. Consider disabling or restricting the use of org-link-expand-abbrev or related dynamic link expansion features if feasible in the short term. 8. Maintain updated backups and incident response plans to quickly recover from potential compromises.
Technical Details
- Data Version
- 5.1
- Assigner Short Name
- mitre
- Date Reserved
- 2024-06-23T00:00:00.000Z
- Cvss Version
- 3.1
- State
- PUBLISHED
Threat ID: 699f6c86b7ef31ef0b565dd1
Added to database: 2/25/2026, 9:41:26 PM
Last enriched: 2/28/2026, 4:21:45 AM
Last updated: 4/12/2026, 5:08:32 AM
Views: 9
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.