-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CVE-2024-9681.md: HSTS subdomain overwrites parent cache entry
- Loading branch information
Showing
3 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
HSTS subdomain overwrites parent cache entry | ||
============================================ | ||
|
||
Project curl Security Advisory, November 6th 2024 - | ||
[Permalink](https://curl.se/docs/CVE-2024-9681.html) | ||
|
||
VULNERABILITY | ||
------------- | ||
|
||
When curl is asked to use HSTS, the expiry time for a subdomain might | ||
overwrite a parent domain's cache entry, making it end sooner or later than | ||
otherwise intended. | ||
|
||
This affects curl using applications that enable HSTS and use URLs with the | ||
insecure `HTTP://` scheme and perform transfers with hosts like | ||
`x.example.com` as well as `example.com` where the first host is a subdomain | ||
of the second host. | ||
|
||
(The HSTS cache either needs to have been populated manually or there needs to | ||
have been previous HTTPS accesses done as the cache needs to have entries for | ||
the domains involved to trigger this problem.) | ||
|
||
When `x.example.com` responds with `Strict-Transport-Security:` headers, this | ||
bug can make the subdomain's expiry timeout *bleed over* and get set for the | ||
parent domain `example.com` in curl's HSTS cache. | ||
|
||
The result of a triggered bug is that HTTP accesses to `example.com` get | ||
converted to HTTPS for a different period of time than what was asked for by | ||
the origin server. If `example.com` for example stops supporting HTTPS at its | ||
expiry time, curl might then fail to access `http://example.com` until the | ||
(wrongly set) timeout expires. This bug can also expire the parent's entry | ||
*earlier*, thus making curl inadvertently switch back to insecure HTTP earlier | ||
than otherwise intended. | ||
|
||
INFO | ||
---- | ||
|
||
When triggered, this is a potential minor DoS security problem when trying to | ||
use HTTPS when that no longer works or a cleartext transmission of data that | ||
was otherwise intended to *possibly* be protected. | ||
|
||
But: | ||
|
||
`example.com` as per above is deliberately setup for HSTS, and servers should | ||
probably expect that clients will try upgrading to HTTPS for a while outside | ||
of the time range set in its headers. | ||
|
||
The access that fails in this scenario tries to use plain HTTP to the domain. | ||
Clear text, unprotected, vulnerable. HTTP is an insecure protocol and as such | ||
applications should **not** rely on nor trust such responses, which reduces | ||
the severity of this issue. | ||
|
||
Even without this problem, servers occasionally set HSTS headers but have | ||
problems with their HTTPS offering so this is a scenario that an application | ||
ends up in now and then completely without involving curl issues and therefore | ||
needs to have logic for. An application can for example work around the | ||
situation by simply toggling off HSTS. | ||
|
||
This bug is **not** considered a *C mistake* (ie not likely to have been | ||
avoided had we not been using C). | ||
|
||
This flaw also affects the curl command line tool. | ||
|
||
The Common Vulnerabilities and Exposures (CVE) project has assigned the name | ||
CVE-2024-9681 to this issue. | ||
|
||
CWE-1025: Comparison Using Wrong Factors | ||
|
||
Severity: Low | ||
|
||
AFFECTED VERSIONS | ||
----------------- | ||
|
||
The vulnerable code can only be reached when curl is told to use HSTS. | ||
|
||
- Affected versions: curl 7.74.0 to and including 8.10.1 | ||
- Not affected versions: curl < 7.74.0 and >= 8.11.0 | ||
- Introduced-in: https://github.com/curl/curl/commit/7385610d0c74c6a25 | ||
|
||
libcurl is used by many applications, but not always advertised as such! | ||
|
||
SOLUTION | ||
------------ | ||
|
||
- Fixed-in: https://github.com/curl/curl/commit/a94973805df96269bf | ||
|
||
RECOMMENDATIONS | ||
--------------- | ||
|
||
We suggest you take one of the following actions immediately, in order of | ||
preference: | ||
|
||
A - Upgrade curl and libcurl to version 8.11.0 | ||
|
||
B - Apply the patch to your version and rebuild | ||
|
||
C - Avoid relying on HSTS | ||
|
||
TIMELINE | ||
--------- | ||
|
||
This issue was reported to the curl project on October 7, 2024. We contacted | ||
distros@openwall on October 29, 2024. | ||
|
||
curl 8.11.0 was released on November 6 2024 around 06:00 UTC, coordinated with | ||
the publication of this advisory. | ||
|
||
CREDITS | ||
------- | ||
|
||
- Reported-by: newfunction | ||
- Patched-by: Daniel Stenberg | ||
|
||
Thanks a lot! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters