CVE-2022-45939: OS Command Injection

Published Nov 28, 2022
·
Updated

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.

Affected Software

19 affected componentsFixes available
GNU Emacs<=28.2
Debian Debian Linux=10.0
Debian Debian Linux=11.0
Fedoraproject Fedora=36
Fedoraproject Fedora=37
debian/emacs<1:28.2+1-8
1:28.2+1-8
debian/emacs<1:28.2+1-8
1:28.2+1-8
debian/emacs<1:28.2+1-8
1:28.2+1-8
debian/xemacs21<21.4.24-11
21.4.24-11
debian/emacs
1:28.2+1-15+deb12u41:30.1+1-6+deb13u11:30.2+1-11
debian/xemacs21
21.4.24-1121.4.24-12
alpine/emacs<28.2-r1
28.2-r1
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3
alpine/emacs<28.2-r3
28.2-r3

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/emacs to a version that resolves this vulnerability.

    Fixed in 1:28.2+1-15+deb12u4Fixed in 1:30.1+1-6+deb13u1Fixed in 1:30.2+1-11
  2. Upgrade

    Upgrade debian/xemacs21 to a version that resolves this vulnerability.

    Fixed in 21.4.24-11Fixed in 21.4.24-12
  3. Upgrade

    Upgrade alpine/emacs to a version that resolves this vulnerability.

    Fixed in 28.2-r1
  4. Upgrade

    Upgrade alpine/emacs to a version that resolves this vulnerability.

    Fixed in 28.2-r3
  5. Upgrade

    Upgrade debian/emacs to a version that resolves this vulnerability.

    Fixed in 1:28.2+1-8
  6. Upgrade

    Upgrade debian/xemacs21 to a version that resolves this vulnerability.

    Fixed in 21.4.24-11
  7. Upgrade

    Upgrade to a fixed release to a version that resolves this vulnerability.

    Patch d48bb4874bc6cd3e69c7a15fc3c91cc141025c51
  8. Compensating control

    Avoid running the ctags command (e.g., 'ctags *') in a working directory whose file names may depend on untrusted input.

Event History

Nov 28, 2022
CVE Published
via MITRE·12:00 AM
Data Sourced
via MITRE·12:00 AM
Description
Data Sourced
via OSV·12:00 AM
DescriptionSeverity
Data Sourced
via NVD·06:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Data Sourced
06:42 PM
SeverityAffected Software
Nov 29, 2022
Data Sourced
via Red Hat·06:46 PM
DescriptionSeverityAffected Software
Nov 3, 2026
Data Sourced
via OSV·07:30 AM
Affected Software

Parent advisories

This vulnerability appears in the following advisories.

Peer vulnerabilities

Found alongside the following vulnerabilities.

Frequently Asked Questions

1

What is CVE-2022-45939?

CVE-2022-45939 is a vulnerability in GNU Emacs that allows attackers to execute commands through shell metacharacters in the name of a source-code file.

2

How does CVE-2022-45939 affect GNU Emacs?

CVE-2022-45939 affects GNU Emacs versions up to 28.2.

3

How does CVE-2022-45939 affect Debian Linux?

CVE-2022-45939 affects Debian Linux versions 10.0 and 11.0.

4

How does CVE-2022-45939 affect Fedora Linux?

CVE-2022-45939 affects Fedora Linux versions 36 and 37.

5

How can I fix CVE-2022-45939 in GNU Emacs?

To fix CVE-2022-45939 in GNU Emacs, update to version 28.3 or later.

6

How can I fix CVE-2022-45939 in Debian Linux?

To fix CVE-2022-45939 in Debian Linux, apply the recommended security updates.

7

How can I fix CVE-2022-45939 in Fedora Linux?

To fix CVE-2022-45939 in Fedora Linux, update to a version that includes the security patch.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203