CVE-2024-53920
NoneCVSS
—
EPSS
0.6%
Published
Nov 27, 2024
CISA due date
—
Cloudanix analysis
Opening certain untrusted code files in a popular text editor can let attackers run their own programs on your computer if you use the editor's code-completion features.
- Exploitation
- Requires User Interaction
- Attacker needs
- User Interaction
- Complexity
- Low
- Impact
- Full Compromise
- Component
- Application
- Class
- RCE
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Invoking elisp-completion-at-point or enabling on-the-fly byte compilation on untrusted Emacs Lisp source triggers unsafe macro expansion that executes attacker-controlled code.
Why it matters to the business
Attackers can run arbitrary commands on developer workstations that edit untrusted Lisp files, leading to credential theft, persistence, or lateral movement with low probability of mass exploitation.
How an attack unfolds
An attacker supplies a malicious .el file containing a Lisp macro that performs side effects during expansion. The victim opens the file and either manually requests completion at a point or has flymake/flycheck byte-compilation enabled, causing the macro to execute and deliver a payload.
How to fix it
Upgrade Emacs to a patched release: Debian 11 users to 1:27.1+1-3.1+deb11u6, Debian 12 users to 1:28.2+1-15+deb12u4, or Git checkout 8ac894e2246f25d2a2a97d866b10e6e0b0fede5a. Disable elisp-completion-at-point and byte-compilation features for untrusted buffers until patches are applied.
How to confirm the fix worked
Confirm the running Emacs binary reports a version string matching or newer than the listed fixed releases and test that completion on a sample macro-containing buffer no longer evaluates side effects.
Typical attack path
- Attacker crafts Emacs Lisp source containing a macro with side-effecting forms
- Victim receives or clones the untrusted .el file
- Victim invokes completion or enables on-the-fly diagnosis on the file
- Unsafe macro expansion executes attacker code inside the Emacs process
- Attacker obtains shell access or further persistence on the workstation
How to detect it
Review shell history, Emacs *Messages* buffers, and process creation logs on developer hosts for unexpected Lisp evaluation or child processes spawned shortly after editing .el files; no high-fidelity network or file IOCs are known.
What your security team should do
- Apply the listed package updates on all developer systems within the next sprint
- Add Emacs version checks to configuration-management and image-building pipelines
- Educate users to avoid enabling completion or diagnostics on files from untrusted sources
- Monitor EPSS and KEV feeds for any future increase in exploit maturity
The record
In elisp-mode.el in GNU Emacs through 30.0.92, a user who chooses to invoke elisp-completion-at-point (for code completion) on untrusted Emacs Lisp source code can trigger unsafe Lisp macro expansion that allows attackers to execute arbitrary code. (This unsafe expansion also occurs if a user chooses to enable on-the-fly diagnosis that byte compiles untrusted Emacs Lisp source code.)
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| AlmaLinux:8 | emacs | 0 | 1:26.1-15.el8_10 |
| AlmaLinux:8 | emacs-common | 0 | 1:26.1-15.el8_10 |
| AlmaLinux:8 | emacs-lucid | 0 | 1:26.1-15.el8_10 |
| AlmaLinux:8 | emacs-nox | 0 | 1:26.1-15.el8_10 |
| AlmaLinux:8 | emacs-terminal | 0 | 1:26.1-15.el8_10 |
| AlmaLinux:9 | emacs | 0 | 1:27.2-11.el9_5.2 |
| AlmaLinux:9 | emacs | 0 | 1:27.2-14.el9_6.2 |
| AlmaLinux:9 | emacs-common | 0 | 1:27.2-11.el9_5.2 |
| AlmaLinux:9 | emacs-common | 0 | 1:27.2-14.el9_6.2 |
| AlmaLinux:9 | emacs-filesystem | 0 | 1:27.2-11.el9_5.2 |
| AlmaLinux:9 | emacs-filesystem | 0 | 1:27.2-14.el9_6.2 |
| AlmaLinux:9 | emacs-lucid | 0 | 1:27.2-11.el9_5.2 |
| AlmaLinux:9 | emacs-lucid | 0 | 1:27.2-14.el9_6.2 |
| AlmaLinux:9 | emacs-nox | 0 | 1:27.2-11.el9_5.2 |
| AlmaLinux:9 | emacs-nox | 0 | 1:27.2-14.el9_6.2 |
| Debian:11 | emacs | 0 | No fix |
| Debian:11 | emacs | 0 | 1:27.1+1-3.1+deb11u6 |
| Debian:12 | emacs | 0 | No fix |
| Debian:12 | emacs | 0 | 1:28.2+1-15+deb12u4 |
| Debian:13 | emacs | 0 | No fix |
| Debian:13 | emacs | 0 | 1:30.1+1-1 |
| Debian:14 | emacs | 0 | 1:30.1+1-1 |
| Mageia:9 | emacs | 0 | 29.4-1.2.mga9 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-ESPOS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise High Performance Computing 15 SP4-LTSS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-ESPOS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise High Performance Computing 15 SP5-LTSS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP5 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Module for Basesystem 15 SP6 | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP5 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Module for Desktop Applications 15 SP6 | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Server 15 SP4-LTSS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Server 15 SP5-LTSS | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP4 | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Linux Enterprise Server for SAP Applications 15 SP5 | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Manager Proxy 4.3 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Manager Proxy 4.3 | emacs | 0 | 27.2-150400.3.26.1 |
| SUSE:Manager Server 4.3 | emacs | 0 | 27.2-150400.3.20.2 |
| SUSE:Manager Server 4.3 | emacs | 0 | 27.2-150400.3.26.1 |
| Ubuntu:16.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:16.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:18.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:18.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:20.04:LTS | emacs | 0 | No fix |
| Ubuntu:20.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:20.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:22.04:LTS | emacs | 0 | No fix |
| Ubuntu:22.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:22.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:24.04:LTS | emacs | 0 | No fix |
| Ubuntu:24.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:24.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:24.10 | emacs | 0 | No fix |
| Ubuntu:24.10 | xemacs21 | 0 | No fix |
| Ubuntu:24.10 | xemacs21-packages | 0 | No fix |
| Ubuntu:25.04 | emacs | 0 | No fix |
| Ubuntu:25.04 | xemacs21 | 0 | No fix |
| Ubuntu:25.04 | xemacs21-packages | 0 | No fix |
| Ubuntu:25.10 | emacs | 0 | No fix |
| Ubuntu:25.10 | xemacs21 | 0 | No fix |
| Ubuntu:25.10 | xemacs21-packages | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | emacs24 | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:Pro:16.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | emacs25 | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:Pro:18.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | emacs | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | emacs | 0 | 1:26.3+1-1ubuntu2+esm2 |
| Ubuntu:Pro:20.04:LTS | xemacs21 | 0 | No fix |
| Ubuntu:Pro:20.04:LTS | xemacs21-packages | 0 | No fix |
| Ubuntu:Pro:22.04:LTS | emacs | 0 | 1:27.1+1-3ubuntu5.2+esm1 |
| Ubuntu:Pro:24.04:LTS | emacs | 0 | No fix |
| Ubuntu:Pro:24.04:LTS | emacs | 0 | 1:29.3+1-1ubuntu2+esm3 |
| openSUSE:Leap 15.5 | emacs | 0 | 27.2-150400.3.20.2 |
| openSUSE:Leap 15.6 | emacs | 0 | 27.2-150400.3.20.2 |
| openSUSE:Leap 15.6 | emacs | 0 | 27.2-150400.3.26.1 |
| openSUSE:Tumbleweed | emacs | 0 | 29.4-11.1 |
Related vulnerabilities
- CVE-2024-39331 In Emacs before 29.4, org-link-expand-abbrev in lisp/ol.el expands a %(...) link abbrev… Also affects emacs
- CVE-2024-30203 In Emacs before 29.3, Gnus treats inline MIME contents as trusted. Also affects emacs
- CVE-2024-30205 In Emacs before 29.3, Org mode considers contents of remote files to be trusted. Also affects emacs
- CVE-2024-30204 In Emacs before 29.3, LaTeX preview is enabled by default for e-mail attachments. Also affects emacs
- CVE-2024-30202 In Emacs before 29.3, arbitrary Lisp code is evaluated as part of turning on Org mode. Also affects emacs
- CVE-2026-6861 A flaw was found in GNU Emacs. Also affects emacs