Vulnerability · Published Oct 18, 2023 · Assigned by hackerone
CVE-2023-38545
High 8.8
In plain English
A high-severity out-of-bounds write in curl from curl. Proof-of-concept exploit code is public. The chance it is exploited in the next 30 days is estimated at 78.7% (higher than 99.6% of all known vulnerabilities). Ready-made attack tooling exists: public proof-of-concept code. Fixed versions are available - upgrade the affected package.
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.
Affected packages & fixed versions
| Ecosystem | Package | Fixed in | Advisory |
|---|---|---|---|
| AlmaLinux:9 | curl | 7.76.1-26.el9_3.2 | ALSA-2023:6745 |
| AlmaLinux:9 | curl | 7.76.1-23.el9_2.4 | ALSA-2023:5763 |
| AlmaLinux:9 | curl-minimal | 7.76.1-26.el9_3.2 | ALSA-2023:6745 |
| AlmaLinux:9 | curl-minimal | 7.76.1-23.el9_2.4 | ALSA-2023:5763 |
| AlmaLinux:9 | libcurl | 7.76.1-26.el9_3.2 | ALSA-2023:6745 |
| AlmaLinux:9 | libcurl | 7.76.1-23.el9_2.4 | ALSA-2023:5763 |
| AlmaLinux:9 | libcurl-devel | 7.76.1-23.el9_2.4 | ALSA-2023:5763 |
| AlmaLinux:9 | libcurl-devel | 7.76.1-26.el9_3.2 | ALSA-2023:6745 |
| AlmaLinux:9 | libcurl-minimal | 7.76.1-23.el9_2.4 | ALSA-2023:5763 |
| AlmaLinux:9 | libcurl-minimal | 7.76.1-26.el9_3.2 | ALSA-2023:6745 |
| Alpine:v3.20 | curl | 8.4.0-r0 | ALPINE-CVE-2023-38545 |
| Alpine:v3.21 | curl | 8.4.0-r0 | ALPINE-CVE-2023-38545 |
| Alpine:v3.22 | curl | 8.4.0-r0 | ALPINE-CVE-2023-38545 |
| Alpine:v3.23 | curl | 8.4.0-r0 | ALPINE-CVE-2023-38545 |
| Alpine:v3.24 | curl | 8.4.0-r0 | ALPINE-CVE-2023-38545 |
| Debian:12 | curl | 7.88.1-10+deb12u4 | DEBIAN-CVE-2023-38545 |
| Debian:12 | curl | 7.88.1-10+deb12u4 | DSA-5523-1 |
| Debian:13 | curl | 8.3.0-3 | DEBIAN-CVE-2023-38545 |
| Debian:14 | curl | 8.3.0-3 | DEBIAN-CVE-2023-38545 |
| Rocky Linux:9 | curl | 0:7.76.1-23.el9_2.4 | RLSA-2023:5763 |
| Ubuntu:22.04:LTS | curl | 7.81.0-1ubuntu1.14 | USN-6429-1 |
| Ubuntu:22.04:LTS | curl | 7.81.0-1ubuntu1.14 | UBUNTU-CVE-2023-38545 |
| Ubuntu:24.04:LTS | curl | 8.2.1-1ubuntu3.1 | UBUNTU-CVE-2023-38545 |
Affected products (as reported)
Weakness: CWE-787 · Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:H/A:H
References
- https://curl.se/docs/CVE-2023-38545.html
- https://security.netapp.com/advisory/ntap-20231027-0009/
- https://lists.fedoraproject.org/archives/list/package-announce@lists.fedoraproject.org/message/OGMXNRNSJ4ETDK6FRNU3J7SABXPWCHSQ/
- https://www.secpod.com/blog/high-severity-heap-buffer-overflow-vulnerability/
- https://support.apple.com/kb/HT214036
- https://support.apple.com/kb/HT214063
- https://support.apple.com/kb/HT214057
- https://support.apple.com/kb/HT214058
- http://seclists.org/fulldisclosure/2024/Jan/34
- http://seclists.org/fulldisclosure/2024/Jan/37
- http://seclists.org/fulldisclosure/2024/Jan/38
- https://security.netapp.com/advisory/ntap-20240201-0005/
- https://forum.vmssoftware.com/viewtopic.php?f=8&t=8868
- https://github.com/bcdannyboy/CVE-2023-38545 exploit
- https://github.com/dbrugman/CVE-2023-38545-POC exploit
- https://github.com/UTsweetyfish/CVE-2023-38545 exploit
- https://cert-portal.siemens.com/productcert/html/ssa-943925.html
- https://cert-portal.siemens.com/productcert/html/ssa-832273.html
- https://cert-portal.siemens.com/productcert/html/ssa-093430.html
- https://cert-portal.siemens.com/productcert/html/ssa-082556.html
- https://cert-portal.siemens.com/productcert/html/ssa-507364.html