cve.bz

CVE-2022-45939 OS Command Injection

7.8 highEPSS 0.7%Fix available

High (7.8). EPSS 0.7% estimated probability of exploitation activity in the next 30 days.

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

Severity

CVSS 3.1

7.8 high
CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
EPSS
0.7% (unchanged from 0.7% a week ago; 0.7% 30 days ago) estimated probability of exploitation activity in the next 30 days; 53rd 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: no · Technical impact: total, assessed 2025-04-28. 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-78 Improper Neutralization of Special Elements used in an OS Command (OS Command Injection)
OWASP Top 10
A05:2025 Injection
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2022-45939 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2022-45939?via=ask-ai-copy and https://cve.bz/cve/CVE-2022-45939?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-2022-45939 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:emacsthrough 28.2
debian:debian_linux10.0
debian:debian_linux11.0
fedoraproject:fedora36
fedoraproject:fedora37

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian10emacs1:26.1+1-3.2+deb10u3DLA-3257-1
Debian11emacs1:27.1+1-3.1+deb11u1DSA-5314-1
Debian12xemacs2121.4.24-11DEBIAN-CVE-2022-45939
Debian12, 13, 14emacs1:28.2+1-8DEBIAN-CVE-2022-45939
Ubuntu16.04:LTS, 18.04:LTS, 20.04:LTS and 5 morexemacs21, xemacs21-packagesno fix listedUBUNTU-CVE-2022-45939
Ubuntu22.04:LTSemacs1:27.1+1-3ubuntu5.2UBUNTU-CVE-2022-45939 USN-7027-1
UbuntuPro:16.04:LTSemacs2424.5+1-6ubuntu1.1+esm1UBUNTU-CVE-2022-45939 USN-5781-1 USN-7027-1
UbuntuPro:18.04:LTSemacs2525.2+1-6ubuntu0.1~esm2UBUNTU-CVE-2022-45939 USN-7027-1
UbuntuPro:20.04:LTSemacs1:26.3+1-1ubuntu2+esm1UBUNTU-CVE-2022-45939 USN-7027-1
UbuntuPro:24.04:LTSemacs1:29.3+1-1ubuntu2+esm1USN-7027-1
Red Hatenterprise_linux:8::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:26.1-9.el8RHSA-2023:3042
Red Hatenterprise_linux:8::baseosemacs, emacs-filesystem1:26.1-9.el8RHSA-2023:3042
Red Hatenterprise_linux:9::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:27.2-8.el9RHSA-2023:2366
Red Hatrhel_eus:8.6::appstreamemacs, emacs-nox, emacs-lucid and 7 more1:26.1-7.el8_6.3RHSA-2024:1103
Red Hatrhel_eus:8.6::baseosemacs, emacs-filesystem1:26.1-7.el8_6.3RHSA-2024:1103
SUSEEnterprise Storage 6, Enterprise Storage 7, Linux Enterprise High Performance Computing 15 SP1-ESPOS and 18 moreemacs25.3-150000.3.12.1SUSE-SU-2022:4310-1
SUSELinux Enterprise Module for Basesystem 15 SP4, Linux Enterprise Module for Desktop Applications 15 SP4emacs27.2-150400.3.3.1SUSE-SU-2022:4304-1
SUSELinux Enterprise Server 12 SP2-BCL, Linux Enterprise Server 12 SP3-BCL, Linux Enterprise Server 12 SP4-LTSS and 5 moreemacs24.3-25.9.1SUSE-SU-2022:4305-1
openSUSELeap 15.3emacs25.3-150000.3.12.1SUSE-SU-2022:4310-1
openSUSELeap 15.4emacs27.2-150400.3.3.1SUSE-SU-2022:4304-1
openSUSETumbleweedemacs28.2-1.1openSUSE-SU-2024:12541-1
AlmaLinux8emacs, emacs-nox, emacs-lucid and 3 more1:26.1-9.el8ALSA-2023:3042
AlmaLinux9emacs, emacs-nox, emacs-lucid and 2 more1:27.2-8.el9ALSA-2023:2366
Alpinev3.17emacs28.2-r1ALPINE-CVE-2022-45939
Alpinev3.18, v3.19, v3.20 and 4 moreemacs28.2-r3ALPINE-CVE-2022-45939
Azure Linux2emacs28.1-5AZL-11515

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; the Alpine secdb, CC BY-SA 4.0; 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 · Alpine.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

This vulnerability is only triggered when a local user runs etags with untrusted input, via a file with a crafted filename in the directory or set of files being processed by etags, for example. For this reason, this flaw has been rated with a moderate security impact.

Red Hat's mitigation

Do not run Etags with untrusted input, in an untrusted directory or set of files, for example.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 8emacs-1:26.1-9.el8Fixed 2023-05-16RHSA-2023:3042
Red Hat Enterprise Linux 8.6 Extended Update Supportemacs-1:26.1-7.el8_6.3Fixed 2024-03-05RHSA-2024:1103
Red Hat Enterprise Linux 9emacs-1:27.2-8.el9Fixed 2023-05-09RHSA-2023:2366
Red Hat Enterprise Linux 6emacsOut of support scope
Red Hat Enterprise Linux 7emacsOut of support scope

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-2022-45939.

Attack patterns (CAPEC)

  • CAPEC-6 Argument Injection Likelihood: High · Severity: High
  • CAPEC-15 Command Delimiters Likelihood: High · Severity: High
  • CAPEC-43 Exploiting Multiple Input Interpretation Layers Likelihood: Medium · Severity: High
  • CAPEC-88 OS Command Injection Likelihood: High · Severity: High
  • CAPEC-108 Command Line Execution through SQL Injection Likelihood: Low · Severity: Very High

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

References

Check your stackJSON