fix: strip credential headers on cross-origin redirects - #391
Conversation
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
I found one substantive credential-forwarding gap in the new classification reuse; details inline.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fa5af9c23c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
fa5af9c to
cbbd8a1
Compare
HAYDEN-OAI
left a comment
There was a problem hiding this comment.
Re-reviewed the updated head. The shared classifier now covers the fixed credential headers plus case-insensitive hyphen/underscore-delimited key, token, secret, password, credential, signature, and authorization suffixes; symbol and mixed-case inputs normalize consistently. Redirect filtering remains gated strictly on an origin change, preserves same-origin credentials, independently strips Host, and correctly exempts the standard non-credential Idempotency-Key while logging still redacts its value. The added end-to-end coverage exercises the reported variants and safe-header retention. My prior finding is resolved and I found no further substantive issues.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e6e0db2967
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Summary
Hoststripping, same-origin credentials, andIdempotency-Keyrequest semantics.302with a custom HTTP transport and cover mixed string/symbol header names,api-key,x-api-key,x-amz-security-token,x-auth-token,x-goog-api-key,x-client-secret,api_key,x-password, authorization, cookies, proxy credentials, and harmless header retention.Castiron / generator ownership
No upstream Castiron/compiler/template/schema change or companion regeneration is required.
CONTRIBUTING.mdstates SDK-local modifications persist across generations.lib/openai/internal/transport/base_client.rbpath as SDK-owned runtime, distinguishes it from Castiron-owned root/client files, and states it will not be overwritten by regeneration..castiron.stats.yml, the transformed OpenAPI specification, and generated resources without touching this runtime or its tests.Verification
api-key,x-api-key, andx-amz-security-tokenreach the attacker origin.main: 641 tests, 2,611 assertions, zero failures/errors/skips.main: 641 tests, 2,611 assertions, zero failures/errors/skips.main: 641 tests, 2,611 assertions, zero failures/errors/skips.bundle exec rake build:gem: succeeds.