CVE-2023-38408 - Unquoted Search Path or Element

Severity

98%

Complexity

39%

Confidentiality

98%

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.

CVSS 3.1 Base Score 9.8. CVSS Attack Vector: network. CVSS Attack Complexity: low. CVSS Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Demo Examples

Unquoted Search Path or Element

CWE-428

The following example demonstrates the weakness.


               
UINT errCode = WinExec( "C:\\Program Files\\Foo\\Bar", SW_SHOW );

Overview

First reported 1 year ago

2023-07-20 03:15:00

Last updated 1 year ago

2023-12-22 22:15:00

Affected Software

OpenBSD OpenSSH

References

https://github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8

https://www.openssh.com/txt/release-9.3p2

https://www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txt

https://blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forwarded-ssh-agent

https://news.ycombinator.com/item?id=36790196

https://github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca

https://github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d

https://www.openssh.com/security.html

GLSA-202307-01

[oss-security] 20230719 Re: CVE-2023-38408: Remote Code Execution in OpenSSH's forwarded ssh-agent

[oss-security] 20230720 Re: Announce: OpenSSH 9.3p2 released

http://packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.html

FEDORA-2023-878e04f4ae

FEDORA-2023-79a18e1725

https://github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8

Patch

https://www.openssh.com/txt/release-9.3p2

Release Notes

https://www.qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txt

Exploit, Third Party Advisory

https://blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-forwarded-ssh-agent

Third Party Advisory

https://news.ycombinator.com/item?id=36790196

Issue Tracking, Patch

https://github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca

Patch

https://github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d

Patch

https://www.openssh.com/security.html

Vendor Advisory

GLSA-202307-01

Third Party Advisory

[oss-security] 20230719 Re: CVE-2023-38408: Remote Code Execution in OpenSSH's forwarded ssh-agent

Exploit, Mailing List, Third Party Advisory

[oss-security] 20230720 Re: Announce: OpenSSH 9.3p2 released

Mailing List, Third Party Advisory

http://packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.html

Exploit, Third Party Advisory, VDB Entry

FEDORA-2023-878e04f4ae

Mailing List

FEDORA-2023-79a18e1725

Mailing List

https://security.netapp.com/advisory/ntap-20230803-0010/

[debian-lts-announce] 20230817 [SECURITY] [DLA 3532-1] openssh security update

[oss-security] 20230922 Re: illumos (or at least danmcd) membership in the distros list

[oss-security] 20230922 Re: illumos (or at least danmcd) membership in the distros list

FEDORA-2023-878e04f4ae

FEDORA-2023-79a18e1725

https://support.apple.com/kb/HT213940

Stay updated

ExploitPedia is constantly evolving. Sign up to receive a notification when we release additional functionality.

Get in touch

If you'd like to report a bug or have any suggestions for improvements then please do get in touch with us using this form. We will get back to you as soon as we can.