HexBrain

Internet Bug Bounty · Report #1874716

CVE-2023-23915: HSTS amnesia with --parallel

Validstatus
lowseverity
$480bounty
8upvotes
24 Feb 2023disclosed

Summary

CVE-2023-23915: HSTS amnesia with --parallel Project curl Security Advisory, February 15 2023

VULNERABILITY curl's HSTS cache saving behaves wrongly when multiple URLs are requested in parallel.

Using its HSTS support, curl can be instructed to use HTTPS instead of using an insecure clear-text HTTP step even when HTTP is provided in the URL. This HSTS mechanism would however surprisingly fail when multiple transfers are done in parallel as the HSTS cache file gets overwritten by the most recently completed transfer.

A later HTTP-only transfer to the earlier host name would then not get upgraded properly to HSTS.

Reproducible like this:

curl --hsts hsts.txt --parallel https://curl.se https://example.com curl --hsts hsts.txt http://curl.se We are not aware of any exploit of this flaw.

INFO This is a curl command line issue and does not affect libcurl. This flaw was introduced in commit 7385610d0c7, which was shipped enabled by default from commit d71ff2b9db566b3f in curl 7.77.0. The Common Vulnerabilities and Exposures (CVE) project has assigned the name CVE-2023-23915 to this issue. CWE-319: Cleartext Transmission of Sensitive Information Severity: Low

AFFECTED VERSIONS Affected versions: curl 7.77.0 to and including 7.87.0 Not affected versions: curl < 7.77.0 and curl >= 7.88.0 curl is used by many applications, but not always advertised as such!

THE SOLUTION 7.88.0 will share the HSTS state properly between transfers, making each subsequent save store a complete state. A fix for CVE-2023-23914

RECOMMENDATIONS A - Upgrade curl to version 7.88.0 B - Apply the patch to your local version C - Specify all URLs with HTTPS:// and not HTTP://

TIMELINE This issue was reported to the curl project on December 21, 2022. We contacted distros @ openwall on February 7, 2022.

curl 7.88.0 was released on February 15 2023, coordinated with the publication of this advisory.

CREDITS Reported-by: Harry Sintonen Patched-by: Daniel Stenberg Thanks a lot!

Full Security Advisory: https://curl.se/docs/CVE-2023-23915.html

How it was found

curl's HSTS cache saving behaves wrongly when multiple URLs are requested in parallel.

Using its HSTS support, curl can be instructed to use HTTPS instead of using an insecure clear-text HTTP step even when HTTP is provided in the URL. This HSTS mechanism would however surprisingly fail when multiple transfers are done in parallel as the HSTS cache file gets overwritten by the most recently completed transfer.

A later HTTP-only transfer to the earlier host name would then not get upgraded properly to HSTS.

Impact

Bypass intended security control.

This report was disclosed publicly on HackerOne and belongs to its author and the program. See the original