curl: Out-of-bounds Write
CVE-2023-38545 is a critical-severity out-of-bounds write vulnerability in curl, 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 8.4.0 as the first without the flaw, so updating curl to that release or later removes the exposure. There is no confirmed exploitation so far. EPSS estimates a 78.3% chance of exploitation within 30 days, which is in the top 0.41% of all scored CVEs.
Exploitation in the next 30 days is more likely than not, according to EPSS.
What to do
- Update curl to 8.4.0 or a later version.
- Update Libcurl to 8.4.0 or a later version.
- Update Windows 10 1809 to 10.0.17763.5122 or a later version.
- 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 |
|---|---|---|---|
| Curl | curl | 8.4.0 up to, but not including, 8.4.0 | 8.4.0 |
| Siemens | RUGGEDCOM APE1808 | all versions | Not stated |
| Siemens | SIMATIC S7-1500 CPU 1518-4 PN/DP MFP | V3.1.5 and later | Not stated |
| Siemens | SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP | V3.1.5 and later | Not stated |
| Siemens | SIPLUS S7-1500 CPU 1518-4 PN/DP MFP | V3.1.5 and later | Not stated |
| Haxx | Libcurl | 7.69.0 up to, but not including, 8.4.0 | 8.4.0 |
| Fedora Project | Fedora | 37 | Not stated |
| NetApp | Active Iq Unified Manager | Not specified in the record | Not stated |
| NetApp | Oncommand Insight | Not specified in the record | Not stated |
| NetApp | Oncommand Workflow Automation | Not specified in the record | Not stated |
| Microsoft | Windows 10 1809 | before 10.0.17763.5122 | 10.0.17763.5122 |
| Microsoft | Windows 10 21h2 | before 10.0.19044.3693 | 10.0.19044.3693 |
| Microsoft | Windows 10 22h2 | before 10.0.19045.3693 | 10.0.19045.3693 |
| Microsoft | Windows 11 21h2 | before 10.0.22000.2600 | 10.0.22000.2600 |
| Microsoft | Windows 11 22h2 | before 10.0.22621.2715 | 10.0.22621.2715 |
| Microsoft | Windows 11 23h2 | before 10.0.22631.2715 | 10.0.22631.2715 |
| Microsoft | Windows Server 2019 | before 10.0.17763.5122 | 10.0.17763.5122 |
| Microsoft | Windows Server 2022 | before 10.0.20348.2113 | 10.0.20348.2113 |
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 | 8.8 | High | CISA (ADP) |
Official description
This flaw makes curl overflow a heap based buffer in the SOCKS5 proxy handshake. When curl is asked to pass along the host name to the SOCKS5 proxy to allow that to resolve the address instead of it getting done by curl itself, the maximum length that host name can be is 255 bytes. If the host name is detected to be longer, curl switches to local name resolving and instead passes on the resolved address only. Due to this bug, the local variable that means "let the host resolve the name" could get the wrong value during a slow SOCKS5 handshake, and contrary to the intention, copy the too long host name to the target buffer instead of copying just the resolved address there. The target buffer being a heap based buffer, and the host name coming from the URL that curl has been told to operate with.
Source: the CVE record as published by its numbering authority, via NVD and CVE.org.
The underlying weakness: Out-of-bounds Write
The product writes data past the end, or before the beginning, of the intended buffer.
How developers prevent this class of flaw
- Use a language that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. For example, many languages that perform their own memory management, such as Java and Perl, are not subject to buffer overflows. Other languages, such as Ada and C#, typically provide overflow protection, but the protection can be disabled by the programmer. Be wary that a language's interface to native code may still be subject to overflows, even if the language itself is theoretically safe.
- Use a vetted library or framework that does not allow this weakness to occur or provides constructs that make this weakness easier to avoid. Examples include the Safe C String Library (SafeStr) by Messier and Viega, and the Strsafe.h library from Microsoft. These libraries provide safer versions of overflow-prone string-handling functions.
- Use automatic buffer overflow detection mechanisms that are offered by certain compilers or compiler extensions. Examples include: the Microsoft Visual Studio /GS flag, Fedora/Red Hat FORTIFY_SOURCE GCC flag, StackGuard, and ProPolice, which provide various mechanisms including canary-based detection and range/index checking. D3-SFCV (Stack Frame Canary Validation) from D3FEND discusses canary-based detection in detail.
Timeline
- CVE record published.
- CISA published its SSVC assessment (exploitation: poc, automatable: no, technical impact: total).
- Record last changed materially (score, affected products, status or references).
References
Patches and release notes
- curl.se/docs/CVE-2023-38545.htmlThird Party Advisory
- secpod.com/blog/high-severity-heap-buffer-overflow-vulnerability/Third Party Advisory
Third-party and government advisories
- seclists.org/fulldisclosure/2024/Jan/34Mailing List, Third Party Advisory
- seclists.org/fulldisclosure/2024/Jan/37Mailing List, Third Party Advisory
- seclists.org/fulldisclosure/2024/Jan/38Mailing List, Third Party Advisory
- lists.fedoraproject.org/archives/list/[email protected]/message/OGMXNRNSJ4ETDK6FRNU3J7…Mailing List, Third Party Advisory
- security.netapp.com/advisory/ntap-20231027-0009/Third Party Advisory
- security.netapp.com/advisory/ntap-20240201-0005/Third Party Advisory
- support.apple.com/kb/HT214036Third Party Advisory
- support.apple.com/kb/HT214057Third Party Advisory
- support.apple.com/kb/HT214058Third Party Advisory
- support.apple.com/kb/HT214063Third Party Advisory
Other references
- forum.vmssoftware.com/viewtopic.php?f=8&t=8868
- cert-portal.siemens.com/productcert/html/ssa-082556.html
- cert-portal.siemens.com/productcert/html/ssa-093430.html
- cert-portal.siemens.com/productcert/html/ssa-507364.html
- cert-portal.siemens.com/productcert/html/ssa-832273.html
- cert-portal.siemens.com/productcert/html/ssa-943925.html
- github.com/UTsweetyfish/CVE-2023-38545
- github.com/bcdannyboy/CVE-2023-38545
- github.com/dbrugman/CVE-2023-38545-POC
Other vulnerabilities in curl
- 7.5 High severity
- 9.1 Critical severity
- 7.5 High severity
- 7.5 High severity
- 8.1 High severity
- 9.1 Critical severity
Recent Out-of-bounds Write vulnerabilities
- 9.8 Critical severity
- 7.8 High severity
- 7.5 High severity
- 9.8 Critical severity
- 9.8 Critical severity
- 9.8 Critical severity
Spotted an error? Tell us.