[WRONG BRANCH] fix(server): strip passthrough redirect Location to prevent credential replay - #33
Conversation
|
Warning Review limit reached
Next review available in: 11 seconds Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
Comment |
⏳ DRAFT
What to do
Its title has been prefixed with |
|
✅ Deterministic PR hygiene checks passed. |
Motivation
Locationheader, which can cause clients that follow redirects to replay request bodies and custom admission headers (includingX-OpenCodex-API-Key) to attacker-controlled hosts. This is a high-severity data-plane credential exposure.Description
Locationfrom the passthrough header sanitizer by adding it to theDROPset insrc/server/relay.tsso relayed responses never expose upstream redirect targets.locationfrom the compact passthrough allowlist insrc/server/responses/compact.tsso buffered/compact responses also do not expose upstreamLocation.src/server/responses/core.tsto clarify the manual-redirect behavior and to use the sanitizer that no longer exposesLocation.tests/server-auth.test.tsto assert theLocationis stripped, and add a compact-path test intests/errors-adapter-failure.test.tsasserting compact responses do not exposeLocation.Testing
node_modules/.bin/bun test tests/server-auth.test.ts -t "passthrough pool send strips a 307"andnode_modules/.bin/bun test tests/errors-adapter-failure.test.ts, both passed.node_modules/.bin/bun run typecheck, which passed.node_modules/.bin/bun run privacy:scan, which passed.