Bug 2322969 (CVE-2024-9681)

Summary: CVE-2024-9681 curl: HSTS subdomain overwrites parent cache entry
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: adudiak, csutherl, dfreiber, drow, jburrell, jclere, jmitchel, jtanner, kaycoth, kshier, omaciel, pjindal, plodge, security-response-team, stcannon, szappis, vkumar, vrajput, yguenane
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: ---
Doc Text:
A vulnerability was found in curl. 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 intended.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2326408, 2326403, 2326404, 2326405, 2326406, 2326407    
Bug Blocks:    
Deadline: 2024-11-06   

Description OSIDB Bzimport 2024-10-31 16:20:30 UTC
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.

- 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

Comment 2 TEJ RATHI 2024-11-15 06:47:37 UTC
Vulnerability details and Affectedness:

Introduced-in: https://github.com/curl/curl/commit/7385610d0c74c6a25 (7.74.0)
Fixed-in: https://github.com/curl/curl/commit/a94973805df96269bf (8.11.0)

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