SIMATIC S7-1500 CPU 1518-4 PN/DP MFP: Unquoted Search Path or Element
CVE-2023-38408 is a critical-severity unquoted search path or element vulnerability in SIMATIC S7-1500 CPU 1518-4 PN/DP MFP from Siemens, with a CVSS 3.1 base score of 9.8 out of 10. It can be exploited remotely over the network by an unauthenticated attacker, without any action from a user. The record lists version V3.1.5 as the first without the flaw, so updating SIMATIC S7-1500 CPU 1518-4 PN/DP MFP to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 79.7% chance of exploitation within 30 days, which is in the top 0.39% of all scored CVEs.
Exploitation in the next 30 days is more likely than not, according to EPSS.
What to do
- Update SIMATIC S7-1500 CPU 1518-4 PN/DP MFP to V3.1.5 or a later version.
- Update SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP to V3.1.5 or a later version.
- Update SIPLUS S7-1500 CPU 1518-4 PN/DP MFP to V3.1.5 or a later version.
- Read the advisory on openssh.com for workarounds and exact fixed builds.
- Until you can update, restrict network access to the affected service so it is not reachable from untrusted networks.
Affected products and versions
| Vendor | Product | Affected versions | Fixed in |
|---|---|---|---|
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| Siemens | SIPLUS S7-1500 CPU 1518-4 PN/DP MFP | V3.1.0 up to, but not including, V3.1.5 | V3.1.5 |
| OpenBSD | OpenSSH | before 9.3; 9.3 | 9.3 |
| Fedora Project | Fedora | 37; 38 | Not stated |
Version data comes from the organisation that assigned the CVE. Confirm against the vendor advisory before deciding you are unaffected.
How the severity score breaks down
- Attack vector
- NetworkCan be exploited remotely over a network, including the internet.
- Attack complexity
- LowNo special conditions are needed; the attack works reliably.
- Privileges required
- NoneNo account or login is needed.
- User interaction
- NoneNo action by a victim is required.
- Scope
- UnchangedImpact stays within the vulnerable component.
- Confidentiality
- HighAll data handled by the component can be read.
- Integrity
- HighData or code can be modified at will.
- Availability
- HighThe component can be taken down completely.
Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H. Scored by NVD.
| Scoring system | Score | Severity | Scored by |
|---|---|---|---|
| CVSS 3.1 | 9.8 | Critical | NVD |
| CVSS 3.1 | 9.8 | Critical | CISA (ADP) |
Official 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.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Unquoted Search Path or Element
The product uses a search path that contains an unquoted element, in which the element contains whitespace or other separators. This can cause the product to access resources in a parent path.
How developers prevent this class of flaw
- Properly quote the full search path before executing a program on the system.
- Inputs should be decoded and canonicalized to the application's current internal representation before being validated (CWE-180). Make sure that the application does not decode the same input twice (CWE-174). Such errors could be used to bypass allowlist validation schemes by introducing dangerous inputs after they have been checked.
More Unquoted Search Path or Element vulnerabilities (CWE-428)
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: none, automatable: yes, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Advisories
Patches and release notes
- github.com/openbsd/src/commit/7bc29a9d5cd697290aa056e94ecee6253d3425f8
- github.com/openbsd/src/commit/f03a4faa55c4ce0818324701dadbf91988d7351d
- github.com/openbsd/src/commit/f8f5a6b003981bb824329dc987d101977beda7ca
- news.ycombinator.com/item?id=36790196Issue Tracking
- openssh.com/txt/release-9.3p2Release Notes
Third-party and government advisories
- openwall.com/lists/oss-security/2023/07/20/2Mailing List, Third Party Advisory
- blog.qualys.com/vulnerabilities-threat-research/2023/07/19/cve-2023-38408-remote-code-execution-in-opensshs-f…Third Party Advisory
- security.gentoo.org/glsa/202307-01Third Party Advisory
Technical write-ups (may include proof of concept)
- packetstormsecurity.com/files/173661/OpenSSH-Forwarded-SSH-Agent-Remote-Code-Execution.htmlExploit, Third Party Advisory, VDB Entry
- openwall.com/lists/oss-security/2023/07/20/1Exploit, Mailing List, Third Party Advisory
- qualys.com/2023/07/19/cve-2023-38408/rce-openssh-forwarded-ssh-agent.txtExploit, Third Party Advisory
Other references
- openwall.com/lists/oss-security/2023/09/22/11
- openwall.com/lists/oss-security/2023/09/22/9
- lists.debian.org/debian-lts-announce/2023/08/msg00021.html
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/CEBTJJINE2I3FHAUKKNQ…
- lists.fedoraproject.org/archives/list/package-announce%40lists.fedoraproject.org/message/RAXVQS6ZYTULFAK3TEJH…
- security.netapp.com/advisory/ntap-20230803-0010/
- support.apple.com/kb/HT213940
- vicarius.io/vsociety/posts/exploring-opensshs-agent-forwarding-rce-cve-2023-38408
- cert-portal.siemens.com/productcert/html/ssa-398330.html
Other vulnerabilities in SIMATIC S7-1500 CPU 1518-4 PN/DP MFP
- 9.6 Critical severity
- 9.6 Critical severity
- 9.6 Critical severity
- 7.8 High severity
- 7.1 High severity
- 9.1 Critical severity
Recent Unquoted Search Path or Element vulnerabilities
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.8 High severity
- 7.3 High severity
- 8.8 High severity
Spotted an error? Tell us.