-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Harden 36 reachable security findings across runtime, install, parsers, http #30722
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
ffa0ca0
f5a76d5
1c78d7d
7f6e47f
74bc9af
d9f2e8f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2315,6 +2315,7 @@ impl<'a> HTTPClient<'a> { | |
| Self::ssl_ctx_mut(ctx).release_socket( | ||
| socket, | ||
| self.flags.did_have_handshaking_error && !self.flags.reject_unauthorized, | ||
| self.flags.reject_unauthorized, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 nit: These three Extended reasoning...What the bug isFix #83 adds an The code path that triggers itFor a fresh connection, the current request is the establishing request, so
Why existing code doesn't prevent itThere is no field on Step-by-step proofConsider a sequence of three
ImpactThis errs on the safe side — it never lets a strict caller reuse an actually-unverified socket, so it is not a security hole. It is a keepalive-efficiency regression introduced by fix #83: in workloads that interleave strict and lax requests to the same origin (e.g. a default-strict app that occasionally probes with How to fixThread the provenance through the reuse cycle the same way
This is more invasive than the rest of fix #83 and is fine to defer to a follow-up.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed on the analysis — this can downgrade a strictly-handshaked pooled socket after a lax client touches it, costing a redundant TLS handshake on the next strict reuse. It never lets a strict caller reuse an unverified socket, so it stays conservative. Threading the original handshake's flag through |
||
| self.connected_url.hostname, | ||
| self.connected_url.get_port_auto(), | ||
| self.tls_props.as_ref(), | ||
|
|
@@ -3591,6 +3592,7 @@ impl<'a> HTTPClient<'a> { | |
| Self::ssl_ctx_mut(ctx).release_socket( | ||
| socket, | ||
| self.flags.did_have_handshaking_error && !self.flags.reject_unauthorized, | ||
| self.flags.reject_unauthorized, | ||
| self.connected_url.hostname, | ||
| self.connected_url.get_port_auto(), | ||
| self.tls_props.as_ref(), | ||
|
|
@@ -3812,6 +3814,7 @@ impl<'a> HTTPClient<'a> { | |
| Self::ssl_ctx_mut(ctx).release_socket( | ||
| socket, | ||
| self.flags.did_have_handshaking_error && !self.flags.reject_unauthorized, | ||
| self.flags.reject_unauthorized, | ||
| self.url.hostname, | ||
| self.url.get_port_auto(), | ||
| self.tls_props.as_ref(), | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file is full of magic numbers +2 +5 +7.
Can be replaced with meaningful constants?