CVE-2022-48338
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.
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
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 High
CVSS: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 High
CVSS: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 High
CVSS: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 Critical
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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 High
CVSS: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
| Package | Affected | Fixed |
|---|---|---|
emacsAlmaLinux:9 |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-commonAlmaLinux:9 |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-filesystemAlmaLinux:9 |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-lucidAlmaLinux:9 |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-noxAlmaLinux:9 |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacsAzure Linux:2 |
before 28.2-4 | 28.2-4 |
emacsDebian:12 |
before 1:28.2+1-11 | 1:28.2+1-11 |
emacsDebian:13 |
before 1:28.2+1-11 | 1:28.2+1-11 |
emacsDebian:14 |
before 1:28.2+1-11 | 1:28.2+1-11 |
emacsDebian: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
| Package | Affected | Fixed |
|---|---|---|
emacsMageia:8 |
before 27.1-1.3.mga8 | 27.1-1.3.mga8 |
emacsopenEuler:20.03-LTS-SP1 |
before 27.1-10.oe1 | 27.1-10.oe1 |
emacsopenEuler:20.03-LTS-SP3 |
before 27.1-8.oe1 | 27.1-8.oe1 |
emacsopenEuler:22.03-LTS |
before 27.2-9.oe2203sp1 | 27.2-9.oe2203sp1 |
emacsopenEuler:22.03-LTS-SP1 |
before 27.2-9.oe2203sp1 | 27.2-9.oe2203sp1 |
emacsRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-commonRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-common-debuginfoRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-debuginfoRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-debugsourceRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-filesystemRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-lucidRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-lucid-debuginfoRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-noxRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacs-nox-debuginfoRed Hat:enterprise_linux:9::appstream |
before 1:27.2-8.el9_2.1 | 1:27.2-8.el9_2.1 |
emacsSUSE:Linux Enterprise Module for Basesystem 15 SP4 |
before 27.2-150400.3.6.1 | 27.2-150400.3.6.1 |
emacsSUSE:Linux Enterprise Module for Desktop Applications 15 SP4 |
before 27.2-150400.3.6.1 | 27.2-150400.3.6.1 |
emacsopenSUSE:Leap 15.4 |
before 27.2-150400.3.6.1 | 27.2-150400.3.6.1 |
xemacs21Ubuntu:16.04:LTS |
All versions, plus listed versions 21.4.22-4ubuntu321.4.22-14ubuntu1 |
None known |
xemacs21-packagesUbuntu:16.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.2-2 |
None known |
xemacs21Ubuntu:18.04:LTS |
All versions, plus listed versions 21.4.24-4ubuntu121.4.24-5ubuntu1 |
None known |
xemacs21-packagesUbuntu:18.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.2-4 |
None known |
xemacs21Ubuntu:20.04:LTS |
All versions, plus listed versions 21.4.24-8build121.4.24-9 |
None known |
xemacs21-packagesUbuntu:20.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.2-42009.02.17.dfsg.2-5 |
None known |
emacsUbuntu: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 |
xemacs21Ubuntu:22.04:LTS |
All versions, plus listed versions 21.4.24-9ubuntu2 |
None known |
xemacs21-packagesUbuntu:22.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.2-5 |
None known |
xemacs21Ubuntu:24.04:LTS |
All versions, plus listed versions 21.4.24-1221.4.24-12build221.4.24-12build3 |
None known |
xemacs21-packagesUbuntu:24.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.3-22009.02.17.dfsg.3-3 |
None known |
xemacs21Ubuntu:25.10 |
All versions, plus listed versions 21.4.24-12build3 |
None known |
xemacs21-packagesUbuntu:25.10 |
All versions, plus listed versions 2009.02.17.dfsg.3-3 |
None known |
xemacs21Ubuntu:26.10 |
All versions, plus listed versions 21.4.24-12build3 |
None known |
xemacs21-packagesUbuntu:26.10 |
All versions, plus listed versions 2009.02.17.dfsg.3-3build1 |
None known |
xemacs21Ubuntu:26.04:LTS |
All versions, plus listed versions 21.4.24-12build3 |
None known |
xemacs21-packagesUbuntu:26.04:LTS |
All versions, plus listed versions 2009.02.17.dfsg.3-32009.02.17.dfsg.3-3build1 |
None known |
emacs24Ubuntu: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 less24.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 |
emacs25Ubuntu:Pro:18.04:LTS |
before 25.2+1-6ubuntu0.1~esm2, plus listed versions 25.2+1-6 |
25.2+1-6ubuntu0.1~esm2 |
emacsUbuntu: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 |
emacsUbuntu: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 |
emacsopenSUSE:Tumbleweed |
before 28.2-2.1 | 28.2-2.1 |
History
| Recorded | Changed | Sources |
|---|---|---|
| first indexed | CVE 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
git.savannah.gnu.org/cgit/emacs.git/commit?id=9a3b08061feea14d6f37685ca1ab8801758bfd1c
debian.org/security/2023/dsa-5360
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/U6HDBUQNAH2WL4MHWCTUZLN7NGF7CHTK
lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/FLPQ4K6H2S5TY3L5UDN4K4B3L5RQJYQ6
nvd.nist.gov/vuln/detail/CVE-2022-48338
lists.fedoraproject.org/archives/list/[email protected]/message/FLPQ4K6H2S5TY3L5UDN4K4B3L5RQJYQ6
Show 48 moreShow less
lists.fedoraproject.org/archives/list/[email protected]/message/U6HDBUQNAH2WL4MHWCTUZLN7NGF7CHTK
github.com/advisories/GHSA-hm6m-2xg8-mc5q
access.redhat.com/errata/RHSA-2023:2626
access.redhat.com/security/cve/CVE-2022-48337
access.redhat.com/security/cve/CVE-2022-48338
access.redhat.com/security/cve/CVE-2022-48339
access.redhat.com/security/cve/CVE-2023-2491
bugzilla.redhat.com/2171987
bugzilla.redhat.com/2171988
bugzilla.redhat.com/2171989
bugzilla.redhat.com/2192873
errata.almalinux.org/9/ALSA-2023-2626.html
github.com/CVEProject/cvelistV5/tree/main/cves/2022/48xxx/CVE-2022-48338.json
security-tracker.debian.org/tracker/CVE-2022-48338
advisories.mageia.org/MGASA-2023-0081.html
bugs.mageia.org/show_bug.cgi?id=31593
openeuler.org/en/security/safety-bulletin/detail.html?id=openEuler-SA-2023-1148
nvd.nist.gov/vuln/detail/CVE-2022-48339
nvd.nist.gov/vuln/detail/CVE-2022-48337
access.redhat.com/security/updates/classification
bugzilla.redhat.com/show_bug.cgi?id=2171987
bugzilla.redhat.com/show_bug.cgi?id=2171988
bugzilla.redhat.com/show_bug.cgi?id=2171989
bugzilla.redhat.com/show_bug.cgi?id=2192873
security.access.redhat.com/data/csaf/v2/advisories/2023/rhsa-2023_2626.json
cve.org/CVERecord?id=CVE-2022-48337
cve.org/CVERecord?id=CVE-2022-48338
cve.org/CVERecord?id=CVE-2022-48339
cve.org/CVERecord?id=CVE-2023-2491
nvd.nist.gov/vuln/detail/CVE-2023-2491
suse.com/support/update/announcement/2023/suse-su-20230598-1
bugzilla.suse.com/1208512
bugzilla.suse.com/1208514
bugzilla.suse.com/1208515
suse.com/security/cve/CVE-2022-48337
suse.com/security/cve/CVE-2022-48338
suse.com/security/cve/CVE-2022-48339
ubuntu.com/security/CVE-2022-48338
ubuntu.com/security/notices/USN-7027-1
ubuntu.com/security/CVE-2022-45939
ubuntu.com/security/CVE-2022-48337
ubuntu.com/security/CVE-2022-48339
ubuntu.com/security/CVE-2023-28617
ubuntu.com/security/CVE-2024-30203
ubuntu.com/security/CVE-2024-30204
ubuntu.com/security/CVE-2024-30205
ubuntu.com/security/CVE-2024-39331
launchpad.net/bugs/2070418