Skip to content
Fencer Vulns
high 7.8

CVE-2022-45939 json

GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file, because lib-src/eta…

published 2022-11-28 3 y ago modified 2026-06-17 4 mo ago also EUVD-2022-48781

cvss
7.8
version 3.1, CNA
cisa kev
Not listed
not in CISA's catalog
epss
0.7%
EPSS 0.7% chance of exploitation in 30 days, percentile 52%
public exploits
0
none known

Summary

GNU Emacs through 28.2 allows attackers to execute commands via shell metacharacters in the name of a source-code file, because lib-src/etags.c uses the system C library function in its implementation of the ctags program. For example, a victim may use the "ctags *" command (suggested in the ctags documentation) in a situation where the current working directory has contents that depend on untrusted input.

Patch / fix

  • emacs Debian 14, Debian 13, Debian 12 1:28.2+1-8
  • xemacs21 Debian 12 21.4.24-11

debian advisories DEBIAN-CVE-2022-45939

  • emacs Ubuntu 22.04 LTS 1:27.1+1-3ubuntu5.2
  • emacs Ubuntu Pro 20.04 LTS 1:26.3+1-1ubuntu2+esm1
  • emacs24 Ubuntu Pro 16.04 LTS 24.5+1-6ubuntu1.1+esm1
  • emacs25 Ubuntu Pro 18.04 LTS 25.2+1-6ubuntu0.1~esm2

ubuntu advisories UBUNTU-CVE-2022-45939

Ubuntu security data © Canonical Ltd., from https://github.com/canonical/ubuntu-security-notices via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • emacs RHEL 8 1:26.1-9.el8
  • emacs-nox RHEL 8 1:26.1-9.el8
  • emacs-lucid RHEL 8 1:26.1-9.el8
  • emacs-common RHEL 8 1:26.1-9.el8
  • emacs-terminal RHEL 8 1:26.1-9.el8
  • emacs-filesystem RHEL 8 1:26.1-9.el8
  • emacs RHEL 9 1:27.2-8.el9
  • emacs-nox RHEL 9 1:27.2-8.el9

red hat advisories RHSA-2024:1103RHSA-2023:3042RHSA-2023:2366

  • emacs SLES for SAP 15 SP2, SLES for SAP 15 SP1, SLES for SAP 15 +19 more 25.3-150000.3.12.1
  • emacs SLES for SAP 12 SP5, SLES for SAP 12 SP4, SLES 12 SP5 +5 more 24.3-25.9.1
  • emacs SLE Module for Desktop Applications 15 SP4, SLE Module for Basesystem 15 SP4, openSUSE Leap 15.4 27.2-150400.3.3.1

suse advisories SUSE-SU-2022:4310-1SUSE-SU-2022:4305-1SUSE-SU-2022:4304-1

  • emacs openSUSE Tumbleweed 28.2-1.1

opensuse advisories openSUSE-SU-2024:12541-1

  • emacs AlmaLinux 8 1:26.1-9.el8
  • emacs-nox AlmaLinux 8 1:26.1-9.el8
  • emacs-lucid AlmaLinux 8 1:26.1-9.el8
  • emacs-common AlmaLinux 8 1:26.1-9.el8
  • emacs-terminal AlmaLinux 8 1:26.1-9.el8
  • emacs-filesystem AlmaLinux 8 1:26.1-9.el8
  • emacs AlmaLinux 9 1:27.2-8.el9
  • emacs-nox AlmaLinux 9 1:27.2-8.el9

almalinux advisories ALSA-2023:3042ALSA-2023:2366

  • emacs Alpine 3.17 28.2-r1
  • emacs Alpine 3.24, Alpine 3.23, Alpine 3.22 +4 more 28.2-r3

alpine advisories ALPINE-CVE-2022-45939

Alpine secdb © Alpine Linux, from https://secdb.alpinelinux.org via OSV; changed: normalised to fixed package versions per release. CC BY-SA 4.0

  • emacs CBL-Mariner 2.0 28.1-5

azure linux advisories AZL-11515

Azure Linux vulnerability data, Copyright (c) Microsoft Corporation, from https://github.com/microsoft/AzureLinuxVulnerabilityData via OSV, under the MIT licence; changed: normalised to fixed package versions per release. MIT

Vendor advisories

What the vendors themselves say about their products: affected, fixed or not affected, and what to do.

red hat product security vex CVE-2022-45939 updated cvss 7.8

emacs: ctags local command execution vulnerability

  • Red Hat Enterprise Linux 6 emacs, emacs-el, emacs-nox, emacs-common Red Hat Enterprise Linux 7 emacs, emacs-el, emacs-nox, emacs-common, emacs-terminal, emacs-filesystem
    affected: workaround, no fix planned “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.”
  • Red Hat Enterprise Linux AppStream (v. 8) emacs 26.1-9.el8, emacs-nox 26.1-9.el8, emacs-lucid 26.1-9.el8, emacs-common 26.1-9.el8, emacs-terminal 26.1-9.el8
    fixed: vendor fix “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.” RHSA-2023:3042
  • Red Hat Enterprise Linux AppStream (v. 9) emacs 27.2-8.el9, emacs-nox 27.2-8.el9, emacs-lucid 27.2-8.el9, emacs-common 27.2-8.el9, emacs-filesystem 27.2-8.el9
    fixed: vendor fix “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.” RHSA-2023:2366
  • Red Hat Enterprise Linux AppStream EUS (v.8.6) emacs 26.1-7.el8_6.3, emacs-nox 26.1-7.el8_6.3, emacs-lucid 26.1-7.el8_6.3, emacs-common 26.1-7.el8_6.3, emacs-terminal 26.1-7.el8_6.3
    fixed: vendor fix “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.” RHSA-2024:1103
  • Red Hat Enterprise Linux BaseOS (v. 8) emacs 26.1-9.el8, emacs-filesystem 26.1-9.el8
    fixed: vendor fix “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.” RHSA-2023:3042
  • Red Hat Enterprise Linux BaseOS EUS (v.8.6) emacs 26.1-7.el8_6.3, emacs-filesystem 26.1-7.el8_6.3
    fixed: vendor fix “Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.” RHSA-2024:1103

Red Hat CSAF VEX © Red Hat, Inc., from https://security.access.redhat.com/data/csaf/v2/vex/; changed: reduced to product statuses and remediations. CC BY 4.0 · csaf

CISA SSVC

Exploitation
none
Automatable
no
Technical impact
total
Assessed
18 mo ago

Exploit prediction

0.67% chance of exploitation in the next 30 days, higher than 52% of all scored CVEs (FIRST EPSS, 2026-11-08).

CVSS scores

assigned by version score vector
CISA ADP 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
NVD 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
CNA 3.1 7.8 CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H

Classification

Weakness
  • CWE-78 Improper Neutralization of Special Elements used in an OS Command

References

Sources

Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.