# 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.

CVE record · `CVE-2024-39331`

- **Identifiers:** `CVE-2024-39331`
- **State:** Confirmed
- **Severity:** CVSS 9.8 Critical
- **Critical:** Yes: CVSS 9+
- **CNA:** mitre
- **Weakness (CWE):** [CWE-94](https://cwe.mitre.org/data/definitions/94.html)
- **Tags:** [Code injection](https://agentprime.io/advisories/tag/code-injection.md)
- **Published:** 23 Jun 2024
- **Updated:** 4 Nov 2026
- **Reviewed by a person:** No

Published by the CVE Program (CNA: mitre) at 23 Jun 2024, 00:00 UTC. agentprime has not analysed this yet, so whether it affects any app is not known. This CVE names a vendor and product rather than a package, so the lockfile check doesn’t match it.

## Critical

Critical, because:

- CVSS score 9.8: 9.0 or more.

How we decide what’s critical: <https://agentprime.io/advisories/critical.md>

## Affected products, as the CNA wrote them

- Vendor: Not given. Product: Not given.
  - affected: `n/a`

## Machine-written summary

Summary written by Claude Haiku from the source advisory. Not reviewed by a person.

> Emacs before 29.4 is vulnerable: org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev even when it names an unsafe function such as shell-command-to-string. The source says this also affects Org Mode before 9.7.5. The source does not list a fixed Emacs or Org Mode version beyond these cutoffs, and it does not describe what an attacker must do to trigger the expansion, so the required access and impact are not stated.

Written 15 Nov 2026.

## Not analysed yet

We haven’t published our own analysis of this CVE. If a person reviews it, this page will say what’s affected and what has to be true for it to matter.

## Severity and exploitation

- 9.8 Critical, CVSS 3.1: `CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H`, from ADP (CISA-ADP)

- **CISA KEV:** Not listed.
- **EPSS:** 0.013, the 71st percentile, on 16 Nov 2026: FIRST’s estimate of the chance of exploitation in the next 30 days.

## Timeline

- 23 Jun 2024, 00:00 UTC: [Confirmed by the CVE List](https://www.cve.org/CVERecord?id=CVE-2024-39331)
- 23 Jun 2024, 22:15 UTC: [Confirmed by NVD](https://nvd.nist.gov/vuln/detail/CVE-2024-39331)

## Sources

- [CVE List: CVE-2024-39331](https://www.cve.org/CVERecord?id=CVE-2024-39331)
- [NVD: CVE-2024-39331](https://nvd.nist.gov/vuln/detail/CVE-2024-39331)

### References from the CNA

- <https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS?h=emacs-29>
- <https://list.orgmode.org/87sex5gdqc.fsf%40localhost/>
- <https://lists.gnu.org/archive/html/info-gnu-emacs/2024-06/msg00000.html>
- <https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=f4cc61636947b5c2f0afc67174dd369fe3277aa8>
- <https://www.openwall.com/lists/oss-security/2024/06/23/1>
- <https://www.openwall.com/lists/oss-security/2024/06/23/2>
- <https://news.ycombinator.com/item?id=40768225>
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00023.html> (mailing-list)
- <https://lists.debian.org/debian-lts-announce/2024/06/msg00024.html> (mailing-list)

Facts on this page come from the CVE List as the CNA published them, with CVSS from the sources named above, CISA KEV and FIRST EPSS. Vendors, products and versions are shown as the CNA wrote them. We don’t reproduce the CVE’s description.

## Check whether this affects you

This CVE names a vendor and product rather than a package, so the lockfile check doesn’t match it. Compare the affected versions above with what you run.

- With the agentprime MCP server (<https://api.agentprime.io/mcp>), `get_advisory` returns this record and `search_advisories` finds related ones. Setup: <https://agentprime.io/mcp.md>
- As JSON: <https://api.agentprime.io/v1/advisories/CVE-2024-39331>
- Everything that needs attention now: <https://agentprime.io/advisories/critical.md>

---

The web page: <https://agentprime.io/advisories/CVE-2024-39331/>. Everything for agents: <https://agentprime.io/llms.txt>.
