Every CVE Search/ Get API key

CVE-2022-48338

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file...

7.3 HighFix available

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Attack profile

How easy it is to exploit

Attack vector
Local
Complexity
Low
Privileges needed
Low
User interaction
Required

What an attacker can affect

Confidentiality
High
Integrity
High
Availability
High

Exploit likelihood

1.64%Up 0.6 points since Feb 21, 2023
90%50%10%1%

What each source reports

NVD Score used 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
CVE-2022-48338
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
CVE List 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
CVE-2022-48338
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
EUVDEUVD-2022-51038 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
EUVD-2022-51038
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-hm6m-2xg8-mc5q 9.8

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file...

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
GHSA-hm6m-2xg8-mc5q
CVSS 3.1
9.8 CriticalCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
Weakness
CWE-77
Updated
2026-11-02
OSVAZL-13681 7.3

CVE-2022-48338 affecting package emacs for versions less than 28.2-4

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
AZL-13681
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSV 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
CVE-2022-48338
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
Show 9 moreShow less
OSVDEBIAN-CVE-2022-48338 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
DEBIAN-CVE-2022-48338
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-03
OSVOESA-2023-1148 7.8

emacs security update

Emacs is the extensible, customizable, self-documenting real-time display editor.At its core is an interpreter for Emacs Lisp, a dialect of the Lisp programming language with extensions to support text editing. And it is an entire ecosystem of functionality beyond text editing,including a project planner, mail and news reader, debugger interface, calendar, and more.

Security Fix(es):

An issue was discovered in GNU Emacs through 28.2. htmlfontify.el has a command injection vulnerability. In the hfy-istext-command function, the parameter file and parameter srcdir come from external input, and parameters are not escaped. If a file name or directory name contains shell metacharacters, code may be executed.(CVE-2022-48339)

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.(CVE-2022-48338)

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 etags program. For example, a victim may use the "etags -u *" command (suggested in the etags documentation) in a situation where the current working directory has contents that depend on untrusted input.(CVE-2022-48337)

Record
OESA-2023-1148
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVRHSA-2023:2626 7.8

Red Hat Security Advisory: emacs security update

Record
RHSA-2023:2626
CVSS 3.1
7.8 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVUBUNTU-CVE-2022-48338 7.3

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed.

Record
UBUNTU-CVE-2022-48338
CVSS 3.1
7.3 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:R/S:U/C:H/I:H/A:H
Updated
2026-11-02
OSVALSA-2023:2626 No score

Important: emacs security update

GNU Emacs is a powerful, customizable, self-documenting text editor. It provides special code editing features, a scripting language (elisp), and the capability to read e-mail and news.

Security Fix(es):

  • emacs: Regression of CVE-2023-28617 fixes in the AlmaLinux (CVE-2023-2491)
  • emacs: command execution via shell metacharacters (CVE-2022-48337)
  • emacs: local command injection in ruby-mode.el (CVE-2022-48338)
  • emacs: command injection vulnerability in htmlfontify.el (CVE-2022-48339)

For more details about the security issue(s), including the impact, a CVSS score, acknowledgments, and other related information, refer to the CVE page(s) listed in the References section.

Record
ALSA-2023:2626
Updated
2026-11-02
OSVMGASA-2023-0081 No score

Updated emacs packages fix security vulnerability

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 etags program. For example, a victim may use the "etags -u *" command (suggested in the etags documentation) in a situation where the current working directory has contents that depend on untrusted input. (CVE-2022-48337)

An issue was discovered in GNU Emacs through 28.2. In ruby-mode.el, the ruby-find-library-file function has a local command injection vulnerability. The ruby-find-library-file function is an interactive function, and bound to C-c C-f. Inside the function, the external command gem is called through shell-command-to-string, but the feature-name parameters are not escaped. Thus, malicious Ruby source files may cause commands to be executed. (CVE-2022-48338)

An issue was discovered in GNU Emacs through 28.2. htmlfontify.el has a command injection vulnerability. In the hfy-istext-command function, the parameter file and parameter srcdir come from external input, and parameters are not escaped. If a file name or directory name contains shell metacharacters, code may be executed. (CVE-2022-48339)

Record
MGASA-2023-0081
Updated
2026-11-02
OSVopenSUSE-SU-2024:12721-1 No score

emacs-28.2-2.1 on GA media

These are all security issues fixed in the emacs-28.2-2.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2024:12721-1
Updated
2026-11-02
OSVSUSE-SU-2023:0598-1 No score

Security update for emacs

This update for emacs fixes the following issues:

  • CVE-2022-48337: Fixed etags local command injection vulnerability (bsc#1208515).
  • CVE-2022-48339: Fixed htmlfontify.el command injection vulnerability (bsc#1208512).
  • CVE-2022-48338: Fixed ruby-mode.el local command injection vulnerability (bsc#1208514).
Record
SUSE-SU-2023:0598-1
Updated
2026-11-02
OSVUSN-7027-1 No score

emacs, emacs24, emacs25 vulnerabilities

It was discovered that Emacs incorrectly handled input sanitization. An attacker could possibly use this issue to execute arbitrary commands. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2022-45939)

Xi Lu discovered that Emacs incorrectly handled input sanitization. An attacker could possibly use this issue to execute arbitrary commands. This issue only affected Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2022-48337)

Xi Lu discovered that Emacs incorrectly handled input sanitization. An attacker could possibly use this issue to execute arbitrary commands. This issue only affected Ubuntu 22.04 LTS. (CVE-2022-48338)

Xi Lu discovered that Emacs incorrectly handled input sanitization. An attacker could possibly use this issue to execute arbitrary commands. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2022-48339)

It was discovered that Emacs incorrectly handled filename sanitization. An attacker could possibly use this issue to execute arbitrary commands. This issue only affected Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2023-28617)

It was discovered that Emacs incorrectly handled certain crafted files. An attacker could possibly use this issue to crash the program, resulting in a denial of service. This issue only affected Ubuntu 16.04 LTS, Ubuntu 18.04 LTS, Ubuntu 20.04 LTS and Ubuntu 22.04 LTS. (CVE-2024-30203, CVE-2024-30204, CVE-2024-30205)

It was discovered that Emacs incorrectly handled certain crafted files. An attacker could possibly use this issue to execute arbitrary commands. (CVE-2024-39331)

Record
USN-7027-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
emacs
AlmaLinux:9
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-common
AlmaLinux:9
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-filesystem
AlmaLinux:9
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-lucid
AlmaLinux:9
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-nox
AlmaLinux:9
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs
Azure Linux:2
before 28.2-4
28.2-4
emacs
Debian:12
before 1:28.2+1-11
1:28.2+1-11
emacs
Debian:13
before 1:28.2+1-11
1:28.2+1-11
emacs
Debian:14
before 1:28.2+1-11
1:28.2+1-11
emacs
Debian:11
before 1:27.1+1-3.1+deb11u2, plus listed versions
1:27.1+1-3.11:27.1+1-3.1+deb11u1
1:27.1+1-3.1+deb11u2
Show 40 moreShow less
Affected packages
PackageAffectedFixed
emacs
Mageia:8
before 27.1-1.3.mga8
27.1-1.3.mga8
emacs
openEuler:20.03-LTS-SP1
before 27.1-10.oe1
27.1-10.oe1
emacs
openEuler:20.03-LTS-SP3
before 27.1-8.oe1
27.1-8.oe1
emacs
openEuler:22.03-LTS
before 27.2-9.oe2203sp1
27.2-9.oe2203sp1
emacs
openEuler:22.03-LTS-SP1
before 27.2-9.oe2203sp1
27.2-9.oe2203sp1
emacs
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-common
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-common-debuginfo
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-debuginfo
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-debugsource
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-filesystem
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-lucid
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-lucid-debuginfo
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-nox
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs-nox-debuginfo
Red Hat:enterprise_linux:9::appstream
before 1:27.2-8.el9_2.1
1:27.2-8.el9_2.1
emacs
SUSE:Linux Enterprise Module for Basesystem 15 SP4
before 27.2-150400.3.6.1
27.2-150400.3.6.1
emacs
SUSE:Linux Enterprise Module for Desktop Applications 15 SP4
before 27.2-150400.3.6.1
27.2-150400.3.6.1
emacs
openSUSE:Leap 15.4
before 27.2-150400.3.6.1
27.2-150400.3.6.1
xemacs21
Ubuntu:16.04:LTS
All versions, plus listed versions
21.4.22-4ubuntu321.4.22-14ubuntu1
None known
xemacs21-packages
Ubuntu:16.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.2-2
None known
xemacs21
Ubuntu:18.04:LTS
All versions, plus listed versions
21.4.24-4ubuntu121.4.24-5ubuntu1
None known
xemacs21-packages
Ubuntu:18.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.2-4
None known
xemacs21
Ubuntu:20.04:LTS
All versions, plus listed versions
21.4.24-8build121.4.24-9
None known
xemacs21-packages
Ubuntu:20.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.2-42009.02.17.dfsg.2-5
None known
emacs
Ubuntu:22.04:LTS
before 1:27.1+1-3ubuntu5.2, plus listed versions
1:27.1+1-3ubuntu31:27.1+1-3ubuntu51:27.1+1-3ubuntu5.1
1:27.1+1-3ubuntu5.2
xemacs21
Ubuntu:22.04:LTS
All versions, plus listed versions
21.4.24-9ubuntu2
None known
xemacs21-packages
Ubuntu:22.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.2-5
None known
xemacs21
Ubuntu:24.04:LTS
All versions, plus listed versions
21.4.24-1221.4.24-12build221.4.24-12build3
None known
xemacs21-packages
Ubuntu:24.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.3-22009.02.17.dfsg.3-3
None known
xemacs21
Ubuntu:25.10
All versions, plus listed versions
21.4.24-12build3
None known
xemacs21-packages
Ubuntu:25.10
All versions, plus listed versions
2009.02.17.dfsg.3-3
None known
xemacs21
Ubuntu:26.10
All versions, plus listed versions
21.4.24-12build3
None known
xemacs21-packages
Ubuntu:26.10
All versions, plus listed versions
2009.02.17.dfsg.3-3build1
None known
xemacs21
Ubuntu:26.04:LTS
All versions, plus listed versions
21.4.24-12build3
None known
xemacs21-packages
Ubuntu:26.04:LTS
All versions, plus listed versions
2009.02.17.dfsg.3-32009.02.17.dfsg.3-3build1
None known
emacs24
Ubuntu:Pro:16.04:LTS
before 24.5+1-6ubuntu1.1+esm4, plus listed versions
24.5+1-1ubuntu224.5+1-1ubuntu424.5+1-1ubuntu524.5+1-1ubuntu624.5+1-1ubuntu7
Show 5 moreShow less
24.5+1-6ubuntu124.5+1-6ubuntu1.124.5+1-6ubuntu1.1+esm124.5+1-6ubuntu1.1+esm224.5+1-6ubuntu1.1+esm3
24.5+1-6ubuntu1.1+esm4
emacs25
Ubuntu:Pro:18.04:LTS
before 25.2+1-6ubuntu0.1~esm2, plus listed versions
25.2+1-6
25.2+1-6ubuntu0.1~esm2
emacs
Ubuntu:Pro:20.04:LTS
before 1:26.3+1-1ubuntu2+esm1, plus listed versions
1:26.3+1-1ubuntu11:26.3+1-1ubuntu2
1:26.3+1-1ubuntu2+esm1
emacs
Ubuntu:Pro:24.04:LTS
before 1:29.3+1-1ubuntu2+esm1, plus listed versions
1:29.1+1-5ubuntu11:29.2+1-1ubuntu11:29.2+1-2ubuntu41:29.3+1-1ubuntu2
1:29.3+1-1ubuntu2+esm1
emacs
openSUSE:Tumbleweed
before 28.2-2.1
28.2-2.1

History

History
RecordedChangedSources
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2022-48338 is a high vulnerability (CVSS 7.3) in Gnu Emacs, published February 20, 2023. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 1.64%, the 76th percentile. Fixed in emacs 1:27.2-8.el9_2.1.

References

Show 48 moreShow less
MoveEnter Open