CVE-2024-39331: Code Injection

Published Jun 23, 2024
·
Updated

GNU Emacs could allow a remote attacker to execute arbitrary code on the system, caused by a code injection flaw in org-link-expand-abbrev in lisp/ol.el. By sending a specially crafted request, an attacker could exploit this vulnerability to execute arbitrary code on the system.

Other sources

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.

— Microsoft

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.

— MITRE

Affected Software

17 affected componentsFixes available
redhat/emacs<29.4
29.4
IBM Cognos Analytics<=12.0.0-12.0.4
IBM Cognos Analytics<=11.2.0-11.2.4 FP5
GNU Emacs<29.4
Microsoft cbl2 emacs 29.3-1
Microsoft azl3 emacs 29.4-1
Microsoft cbl2 emacs 29.3-1
Microsoft azl3 emacs 29.3-2
Microsoft cbl2 emacs 29.4-1
debian/emacs<1:28.2+1-15+deb12u3
1:28.2+1-15+deb12u3
debian/emacs<1:29.4+1-1
1:29.4+1-1
debian/emacs<1:29.4+1-1
1:29.4+1-1
debian/org-mode*
debian/org-mode<9.7.5+dfsg-1
9.7.5+dfsg-1
debian/org-mode<9.7.5+dfsg-1
9.7.5+dfsg-1
debian/emacs
1:28.2+1-15+deb12u41:30.1+1-6+deb13u11:30.2+1-11
debian/org-mode<=9.5.2+dfsh-5
9.7.29+dfsg-19.8.12+dfsg-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade redhat/emacs to a version that resolves this vulnerability.

    Fixed in 29.4
  2. Upgrade

    Upgrade debian/emacs to a version that resolves this vulnerability.

    Fixed in 1:28.2+1-15+deb12u3
  3. Upgrade

    Upgrade debian/emacs to a version that resolves this vulnerability.

    Fixed in 1:29.4+1-1
  4. Upgrade

    Upgrade debian/org-mode to a version that resolves this vulnerability.

    Fixed in 9.7.5+dfsg-1
  5. Upgrade

    Upgrade debian/emacs to a version that resolves this vulnerability.

    Fixed in 1:28.2+1-15+deb12u4Fixed in 1:30.1+1-6+deb13u1Fixed in 1:30.2+1-11
  6. Upgrade

    Upgrade debian/org-mode to a version that resolves this vulnerability.

    Fixed in 9.7.29+dfsg-1Fixed in 9.8.12+dfsg-1
  7. Upgrade

    Upgrade GNU Emacs to a version that resolves this vulnerability.

    Fixed in 29.4
  8. Upgrade

    Upgrade Org Mode to a version that resolves this vulnerability.

    Fixed in 9.7.5

Event History

Jun 23, 2024
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via OSV·12:00 AM
DescriptionSeverity
Data Sourced
via NVD·10:15 PM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
via OSV·10:15 PM
Affected Software
Jun 24, 2024
Data Sourced
via Red Hat·01:38 PM
DescriptionSeverityAffected Software
Aug 5, 2024
Data Sourced
via Microsoft·07:00 AM
DescriptionSeverityWeaknessAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is the severity of CVE-2024-39331?

CVE-2024-39331 is considered a security vulnerability due to unsafe function execution in Emacs' org-link-expand-abbrev.

2

How do I fix CVE-2024-39331?

To fix CVE-2024-39331, upgrade Emacs to version 29.4 or Org Mode to version 9.7.5 or later.

3

Which versions of Emacs are affected by CVE-2024-39331?

Emacs versions prior to 29.4 are affected by CVE-2024-39331.

4

Which versions of Org Mode need to be updated to address CVE-2024-39331?

Org Mode versions before 9.7.5 are affected and should be updated to this version or later.

5

What does CVE-2024-39331 exploit in Emacs?

CVE-2024-39331 exploits the ability to expand unsafe function links in the org-link-expand-abbrev feature of Emacs.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203