CVE-2023-38408
The PKCS#11 feature in ssh-agent in OpenSSH before 9.3p2 has an insufficiently trustworthy search path, leading to remote code execution…
Check your servers for CVE-2023-38408
The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2023-38408 affects a package, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.
Description
The PKCS#11 feature in ssh-agent in OpenSSH before 9.3p2 has an insufficiently trustworthy search path, leading to remote code execution if an agent is forwarded to an attacker-controlled system. (Code in /usr/lib is not necessarily safe for loading into ssh-agent.) NOTE: this issue exists because of an incomplete fix for CVE-2016-10009.
Severity (CVSS)
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
- Attack vector
- network: an attacker can reach the vulnerable part over the network, often from the internet
- Attack complexity
- low: an attack works without special conditions
- Privileges required
- none: the attacker does not need an account
- User interaction
- none: nobody has to click or open anything
- Scope
- unchanged: the damage stays inside the vulnerable component
- Impact
- confidentiality high, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)
Exploitation
EPSS 79.6%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 99.6% of all scored CVEs. Scores of 1 Dec 2026.
The assessment of CISA (SSVC, 15 Oct 2024):
- Exploitation
- none: CISA did not find evidence of exploitation or a public proof of concept
- Automatable
- yes: an attacker can automate the attack across many targets
- Technical impact
- total: full control of the component or of its data
Weakness
- CWE-428 Unquoted Search Path or Element
Affected products
As the CNA lists them.
| Product | Versions |
|---|---|
|
n/a
n/a
|
affected all versions
|
Is my server affected?
Find the installed version of the package (replace PACKAGE with its name) and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.
Debian, Ubuntu
dpkg -l | grep -i PACKAGE
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2023-38408 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2023-38408RHEL, Rocky, Alma, Fedora
rpm -q PACKAGE
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2023-38408Alpine
apk list --installed | grep -i PACKAGEWith Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:
trivy rootfs --scanners vuln / | grep CVE-2023-38408
trivy image --scanners vuln IMAGE | grep CVE-2023-38408
Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.
References
Advisories
- GLSA-202307-01 security.gentoo.org · vendor advisory
- FEDORA-2023-878e04f4ae lists.fedoraproject.org · vendor advisory
- FEDORA-2023-79a18e1725 lists.fedoraproject.org · vendor advisory
Other references
- https://news.ycombinator.com/item?id=36790196 news.ycombinator.com
- https://blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forwarded-ssh-agent blog.qualys.com
- https://www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txt qualys.com
- https://github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca github.com
- https://github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8 github.com
- https://github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d github.com
- https://www.openssh.com/txt/release-9.3p2 openssh.com
- https://www.openssh.com/security.html openssh.com
- [oss-security] 20230719 Re: CVE-2023-38408: Remote Code Execution in OpenSSH's forwarded ssh-agent openwall.com · mailing list
- [oss-security] 20230720 Re: Announce: OpenSSH 9.3p2 released openwall.com · mailing list
- http://packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.html packetstormsecurity.com
- https://security.netapp.com/advisory/ntap-20230803-0010/ security.netapp.com
6 more
- [debian-lts-announce] 20230817 [SECURITY] [DLA 3532-1] openssh security update lists.debian.org · mailing list
- [oss-security] 20230922 Re: illumos (or at least danmcd) membership in the distros list openwall.com · mailing list
- [oss-security] 20230922 Re: illumos (or at least danmcd) membership in the distros list openwall.com · mailing list
- https://support.apple.com/kb/HT213940 support.apple.com
- https://www.vicarius.io/vsociety/posts/exploring-opensshs-agent-forwarding-rce-cve-2023-38408 vicarius.io
- https://cert-portal.siemens.com/productcert/html/ssa-398330.html cert-portal.siemens.com
Source: the record CVE-2023-38408 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.
Vulnpocalypse