Pascal THUET
5601830ba3
harden: bound HTTP reads and enforce strict redirects (#3140)
* harden: bound HTTP reads and enforce strict redirects
Add a shared _download_security module (read_response_limited,
is_https_or_localhost_http, size constants) and route the GitHub release
and Azure DevOps token network reads through bounded reads so an oversized
response can't exhaust memory.
Add a strict_redirects mode to authentication.open_url: the redirect handler
now rejects any redirect whose target isn't HTTPS (or HTTP to localhost),
composing with the existing per-hop redirect_validator and auth-stripping.
The Azure DevOps token POST is routed through that handler so a 307/308
cannot forward the client_secret body to a non-HTTPS host.
Assisted-by: Codex (model: GPT-5, autonomous)
* test: align HTTP fakes with bounded reads
Assisted-by: Codex (model: GPT-5, autonomous)
* fix: tolerate invalid token response encoding
Assisted-by: Codex (model: GPT-5, autonomous)
* test: align GHES fakes with bounded reads
Assisted-by: Codex (model: GPT-5, autonomous)
* test: reuse shared upgrade HTTP response helper
Assisted-by: Codex (model: GPT-5, autonomous)
* fix: include rejected redirect target in error
Assisted-by: Codex (model: GPT-5, autonomous)
* fix: enforce strict redirects by default
Assisted-by: Codex (model: GPT-5, autonomous)
* fix: close redirect credential and SSRF gaps
Assisted-by: Codex (model: GPT-5, autonomous)
2026-07-22 11:08:32 -05:00
..
2026-07-22 08:49:20 -05:00
2026-07-22 09:00:23 -05:00
2026-07-10 11:47:36 -05:00
2026-07-21 18:28:40 +01:00
2026-07-22 11:08:32 -05:00
2026-07-22 08:21:02 -05:00
2026-07-21 08:35:25 -05:00
2026-02-10 14:27:20 -06:00
2026-05-07 12:51:20 -05:00
2026-06-19 17:07:20 -05:00
2026-07-01 15:55:18 -05:00
2026-07-22 11:08:32 -05:00
2026-07-21 11:40:15 -05:00
2026-07-22 11:08:32 -05:00
2026-07-22 07:49:48 -05:00
2026-07-22 11:08:32 -05:00
2026-06-09 06:13:07 -05:00
2026-07-01 13:50:53 -05:00
2026-07-21 11:40:15 -05:00
2026-06-04 11:34:05 -05:00
2026-05-14 12:52:14 -05:00
2026-07-21 11:40:15 -05:00
2026-07-01 16:34:46 -05:00
2026-06-03 16:02:26 -05:00
2026-07-21 11:40:15 -05:00
2026-07-22 11:08:32 -05:00
2026-07-10 11:47:36 -05:00
2026-07-21 09:20:20 -05:00
2026-07-10 11:47:36 -05:00
2026-07-22 11:08:32 -05:00
2026-07-22 11:08:32 -05:00
2026-07-21 18:28:40 +01:00
2026-07-01 15:55:18 -05:00
2026-06-19 12:05:42 -05:00
2026-06-17 06:48:42 -05:00
2026-07-10 11:47:36 -05:00
2026-07-07 11:35:43 -05:00
2026-07-22 11:08:32 -05:00
2026-05-26 13:18:34 -05:00
2026-06-22 10:25:29 -05:00
2026-07-22 05:20:55 -05:00
2026-07-22 11:08:32 -05:00
2026-07-22 11:08:32 -05:00
2026-06-03 12:04:54 -05:00
2026-07-22 11:08:32 -05:00
2026-07-08 07:45:01 -05:00
2026-06-29 16:37:40 -05:00
2026-07-21 11:40:15 -05:00
2026-07-21 11:40:15 -05:00
2026-07-10 11:47:36 -05:00
2026-06-24 14:52:24 -05:00
2026-07-21 11:40:15 -05:00
2026-07-10 11:47:36 -05:00
2026-07-22 11:08:32 -05:00
2026-06-09 06:13:07 -05:00
2026-06-24 13:05:21 -05:00
2026-06-03 16:02:26 -05:00
2026-07-07 14:52:36 -05:00
2026-07-22 11:08:32 -05:00