cve.bz

CVE-2024-39331 gnu emacs: Code Injection

9.8 criticalEPSS 1.3%Fix available

Critical (9.8) in gnu emacs. EPSS 1.3% estimated probability of exploitation activity in the next 30 days.

On this page
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.

Severity

CVSS 3.1

9.8 critical
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS
1.3% (unchanged from 1.3% a week ago; 1.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 71st percentile. Scored 2026-11-22. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: yes · Technical impact: total, assessed 2024-08-22. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWE
CWE-94 Improper Control of Generation of Code (Code Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-39331 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-39331?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-39331?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-39331 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the NVD's CPE matches.

ProductAffected
gnu:emacsbefore 29.4

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10emacs1:26.1+1-3.2+deb10u6DLA-3849-1
Debian10org-mode9.1.14+dfsg-3+deb10u3DLA-3848-1
Debian11emacs1:27.1+1-3.1+deb11u5DSA-5719-1
Debian11org-mode9.4.0+dfsg-1+deb11u3DSA-5718-1
Debian12emacs1:28.2+1-15+deb12u3DEBIAN-CVE-2024-39331 DSA-5719-1
Debian12org-modeno fix listedDEBIAN-CVE-2024-39331
Debian13, 14emacs1:29.4+1-1DEBIAN-CVE-2024-39331
Debian13, 14org-mode9.7.5+dfsg-1DEBIAN-CVE-2024-39331
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 5 morexemacs21, xemacs21-packagesno fix listedUBUNTU-CVE-2024-39331
Ubuntu22.04:LTSemacs1:27.1+1-3ubuntu5.2UBUNTU-CVE-2024-39331 USN-7027-1
UbuntuPro:16.04:LTSemacs2424.5+1-6ubuntu1.1+esm4UBUNTU-CVE-2024-39331 USN-7027-1
UbuntuPro:16.04:LTSorg-mode8.3.3-2ubuntu0.1~esm1UBUNTU-CVE-2024-39331 USN-7375-1
UbuntuPro:18.04:LTSemacs2525.2+1-6ubuntu0.1~esm2UBUNTU-CVE-2024-39331 USN-7027-1
UbuntuPro:18.04:LTSorg-mode9.1.6+dfsg-1ubuntu0.1~esm1UBUNTU-CVE-2024-39331 USN-7375-1
UbuntuPro:20.04:LTSemacs1:26.3+1-1ubuntu2+esm1UBUNTU-CVE-2024-39331 USN-7027-1
UbuntuPro:20.04:LTSorg-mode9.3.1+dfsg-1ubuntu0.1~esm1UBUNTU-CVE-2024-39331 USN-7375-1
UbuntuPro:22.04:LTSorg-mode9.5.2+dfsh-4ubuntu0.1~esm1UBUNTU-CVE-2024-39331 USN-7375-1
UbuntuPro:24.04:LTSemacs1:29.3+1-1ubuntu2+esm1UBUNTU-CVE-2024-39331 USN-7027-1
UbuntuPro:24.04:LTSorg-mode9.6.10+dfsg-1ubuntu0.1~esm1UBUNTU-CVE-2024-39331 USN-7375-1
Red Hatenterprise_linux:8::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:26.1-12.el8_10RHSA-2024:6987
Red Hatenterprise_linux:8::baseosemacs, emacs-filesystem1:26.1-12.el8_10RHSA-2024:6987
Red Hatenterprise_linux:9::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:27.2-10.el9_4RHSA-2024:6510
Red Hatrhel_aus:8.6::appstream, rhel_e4s:8.6::appstream, rhel_tus:8.6::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:26.1-7.el8_6.5RHSA-2024:4971
Red Hatrhel_aus:8.6::baseos, rhel_e4s:8.6::baseos, rhel_tus:8.6::baseosemacs, emacs-filesystem1:26.1-7.el8_6.5RHSA-2024:4971
Red Hatrhel_eus:8.8::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:26.1-10.el8_8.6RHSA-2024:6203
Red Hatrhel_eus:8.8::baseosemacs, emacs-filesystem1:26.1-10.el8_8.6RHSA-2024:6203
SUSEEnterprise Storage 7.1, Linux Enterprise High Performance Computing 15 SP2-LTSS, Linux Enterprise High Performance Computing 15 SP3-LTSS and 4 moreemacs25.3-150000.3.22.1SUSE-SU-2024:2297-1
SUSELinux Enterprise High Performance Computing 15 SP4-ESPOS, Linux Enterprise High Performance Computing 15 SP4-LTSS, Linux Enterprise Module for Basesystem 15 SP5 and 7 moreemacs27.2-150400.3.17.1SUSE-SU-2024:2567-1
SUSELinux Enterprise Server 12 SP5, Linux Enterprise Server for SAP Applications 12 SP5emacs24.3-25.20.1SUSE-SU-2024:2293-1
openSUSELeap 15.5, Leap 15.6emacs27.2-150400.3.17.1SUSE-SU-2024:2567-1
openSUSELeap 16.0syft1.45.0-bp160.1.1openSUSE-SU-2026:20928-1
openSUSETumbleweedemacs29.4-2.1openSUSE-SU-2024:14117-1
openSUSETumbleweedsyft1.42.1-1.1openSUSE-SU-2026:10228-1
AlmaLinux8emacs, emacs-nox, emacs-lucid and 3 more1:26.1-12.el8_10ALSA-2024:6987
AlmaLinux9emacs, emacs-nox, emacs-lucid and 2 more1:27.2-10.el9_4ALSA-2024:6510
Rocky Linux8emacs1:26.1-12.el8_10RLSA-2024:6987
Azure Linux2emacs29.4-1AZL-42925
Azure Linux3emacs29.4-1AZL-42868

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; Red Hat Security Data © Red Hat, Inc., CC BY 4.0; SUSE security data, CC BY 4.0; AlmaLinux's OSV database, MIT; Rocky Linux's errata, BSD-3-Clause; Microsoft's Azure Linux vulnerability data, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · Red Hat · SUSE · openSUSE.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

To exploit this flaw, an attacker needs to trick a user into opening a crafted Org mode file or previewing a crafted email attachment. For this reason, this flaw has been rated with a Moderate security impact.

Red Hat's mitigation

Do not open Org mode files or preview email attachments from untrusted sources.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8emacs-1:26.1-12.el8_10Fixed 2024-09-24RHSA-2024:6987
Red Hat Enterprise Linux 8.6 Advanced Mission Critical Update Supportemacs-1:26.1-7.el8_6.5Fixed 2024-08-01RHSA-2024:4971
Red Hat Enterprise Linux 8.6 Telecommunications Update Serviceemacs-1:26.1-7.el8_6.5Fixed 2024-08-01RHSA-2024:4971
Red Hat Enterprise Linux 8.6 Update Services for SAP Solutionsemacs-1:26.1-7.el8_6.5Fixed 2024-08-01RHSA-2024:4971
Red Hat Enterprise Linux 8.8 Extended Update Supportemacs-1:26.1-10.el8_8.6Fixed 2024-09-03RHSA-2024:6203
Red Hat Enterprise Linux 9emacs-1:27.2-10.el9_4Fixed 2024-09-09RHSA-2024:6510
RHOAI-2.13-RHEL-8rhoai/odh-codeflare-operator-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-dashboard-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-data-science-pipelines-argo-argoexec-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-data-science-pipelines-argo-workflowcontroller-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-data-science-pipelines-operator-controller-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-kf-notebook-controller-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-kuberay-operator-controller-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-kueue-controller-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-mlmd-grpc-server-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-ml-pipelines-api-server-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
RHOAI-2.13-RHEL-8rhoai/odh-ml-pipelines-api-server-v2-rhel8:v2.13.1-1Fixed 2024-10-24RHBA-2024:8413
Red Hat Enterprise Linux 10emacsNot affected
Red Hat Enterprise Linux 6emacsOut of support scope
Red Hat Enterprise Linux 7emacsOut of support scope
51 more in the JSON and on Red Hat's page.

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-39331.

Attack patterns (CAPEC)

  • CAPEC-35 Leverage Executable Code in Non-Executable Files Likelihood: High · Severity: Very High
  • CAPEC-77 Manipulating User-Controlled Variables Likelihood: High · Severity: Very High
  • CAPEC-242 Code Injection Likelihood: High · Severity: High

The attack patterns MITRE's CAPEC relates to this record's weaknesses, as MITRE names them. Credits.

References

Check your stackJSON