{{ message }}
Repository navigation
Security: strip Authorization/Cookie on cross-origin redirects in fetchWithSsrFGuard - #20313
Merged
grp06 merged 3 commits intoFeb 19, 2026
Merged
Conversation
grp06
force-pushed
the
fix/ssrf-cross-origin-redirect-headers
branch
from
February 19, 2026 19:33
1e6aa88 to
6081e2b
Compare
Contributor
anisoptera
pushed a commit
to anisoptera/openclaw
that referenced
this pull request
Feb 20, 2026
mmyyfirstb
pushed a commit
to mmyyfirstb/openclaw
that referenced
this pull request
Feb 21, 2026
lovewanwan
pushed a commit
to lovewanwan/openclaw
that referenced
this pull request
Apr 28, 2026
ogt-redknie
pushed a commit
to ogt-redknie/OPENX
that referenced
this pull request
May 2, 2026
github-actions Bot
pushed a commit
to Desicool/openclaw
that referenced
this pull request
May 9, 2026
lhfer
pushed a commit
to lhfer/openclaw
that referenced
this pull request
Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Describe the problem and fix in 2–5 bullets:
fetchWithSsrFGuardreused request headers across manual redirects, including cross-origin hops.Authorization,Cookie) could be forwarded to a different origin.Change Type (select all)
Scope (select all touched areas)
Linked Issue/PR
User-visible / Behavior Changes
Authorization/Cookieset on the initial request.Security Impact (required)
No)Yes)No)No)No)Yes, explain risk + mitigation:Repro + Verification
Environment
Steps
pnpm test src/infra/net/fetch-guard.ssrf.test.tson the pre-fix code.strips sensitive headers when redirect crosses origins(authorizationwas still present on second request).pnpm test src/infra/net/fetch-guard.ssrf.test.ts src/media/input-files.fetch-guard.test.ts.Expected
Authorization/Cookie.Actual
Authorizationleaked to redirected cross-origin request.Evidence
Attach at least one:
Human Verification (required)
What you personally verified (not just CI), and how:
src/media/input-files.fetch-guard.test.ts) still passes.Compatibility / Migration
Yes)No)No)Failure Recovery (if this breaks)
fbd5511f0.src/infra/net/fetch-guard.tssrc/infra/net/fetch-guard.ssrf.test.tsRisks and Mitigations
Greptile Summary
This PR hardens
fetchWithSsrFGuardby stripping sensitive headers (Authorization,Proxy-Authorization,Cookie,Cookie2) when a manual redirect crosses origins, aligning with browser credential-stripping behavior and preventing credential leakage to unintended hosts.CROSS_ORIGIN_REDIRECT_SENSITIVE_HEADERSconstant andstripSensitiveHeadersForCrossOriginRedirecthelper insrc/infra/net/fetch-guard.tscurrentInitvariable to track evolving request options across redirect hops without mutating the caller's originalparams.initnextParsedUrl.originagainstparsedUrl.originon each redirect to determine if headers should be strippedConfidence Score: 5/5
Last reviewed commit: fbd5511
(3/5) Reply to the agent's comments like "Can you suggest a fix for this @greptileai?" or ask follow-up questions!