Skip to content

fix(builtins): harden curl redirect against credential leaks#1020

Merged
chaliy merged 1 commit intomainfrom
fix/issue-998-curl-redirect-creds
Apr 2, 2026
Merged

fix(builtins): harden curl redirect against credential leaks#1020
chaliy merged 1 commit intomainfrom
fix/issue-998-curl-redirect-creds

Conversation

@chaliy
Copy link
Copy Markdown
Contributor

@chaliy chaliy commented Apr 2, 2026

Summary

  • Strip Authorization, Cookie, Proxy-Authorization headers on cross-origin redirects
  • Convert POST to GET and drop body on 301/302/303 redirects (per HTTP spec)
  • Preserve port in resolve_redirect_url for absolute-path redirects

Closes #998

Test plan

  • New unit tests: port preservation, same_origin, sensitive header stripping (8 tests)
  • Existing curl tests still pass (20 total)
  • cargo clippy -- -D warnings clean
  • cargo fmt --check clean

Closes #998 — Three fixes for curl redirect handling:
1. Strip Authorization/Cookie headers on cross-origin redirects
2. Convert POST to GET on 301/302/303 (drop body per HTTP spec)
3. Preserve port in resolve_redirect_url for absolute-path redirects
@chaliy chaliy merged commit ae4e0e4 into main Apr 2, 2026
27 checks passed
@chaliy chaliy deleted the fix/issue-998-curl-redirect-creds branch April 2, 2026 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Curl redirect handling leaks credentials and drops port in allowlist check

1 participant