Skip to content

fix: strip Proxy-Authorization header on cross-origin redirects - #1870

Open
chiragbitoni wants to merge 1 commit into
forwardemail:masterfrom
chiragbitoni:fix/strip-proxy-authorization-cross-origin-redirect
Open

chiragbitoni wants to merge 1 commit into
forwardemail:masterfrom
chiragbitoni:fix/strip-proxy-authorization-cross-origin-redirect

Conversation

@chiragbitoni

Copy link
Copy Markdown

Fixes #1869

When following redirects across different origins (e.g. 301, 302, 303, 307, 308), superagent strips Authorization and Cookie headers to prevent credential leakage. However, Proxy-Authorization was retained and forwarded to third-party redirect origins.

Changes

  • Strip proxy-authorization alongside authorization and cookie in utils.cleanHeader when changesOrigin is true.
  • Strip proxy-authorization in _redirect for 307/308 redirects when changesOrigin is true.
  • Keep proxy-authorization on same-origin redirects.
  • Add unit tests verifying cross-origin and same-origin redirect behavior for Proxy-Authorization.

This branch has not been deployed

No deployments
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.

Proxy-Authorization is forwarded to a different origin on redirect

1 participant