fix: reject JWT critical headers - #231
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughAdds a fail-closed guard that rejects JWTs containing the ChangesJWT Critical Header Rejection
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@backend/api/auth.py`:
- Around line 219-220: The OIDC RS256 branch calls jwt.decode(...) without
rejecting unsupported "crit" headers—add the same pre-check used in the HS256
fallback to the OIDC path: inspect the JWT header (the same `header` variable)
before calling `jwt.decode` and if "crit" is present raise
`_authentication_error()`; update the OIDC branch where `jwt.decode` is invoked
so it performs `if "crit" in header: raise _authentication_error()` immediately
prior to decoding to mirror the legacy fallback behavior.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 4ccde349-9a9d-4672-9019-a02e6fa9c01f
📒 Files selected for processing (4)
AGENTS.mdbackend/api/auth.pybackend/requirements.txtbackend/tests/test_auth_real.py
|
PR governance metadata gate is not ready for
|
|
Current-head merge gate evidence for
Next action: provide a quota-enabled GPT-5.4+ OpenAI credential or make an OpenAI GPT-5.4+ model available through GitHub Models, then rerun |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
|
Tip For best results, initiate chat on the files or code changes.
There is nothing further I can do to unblock the |
|
Tip For best results, initiate chat on the files or code changes.
There is nothing new I can act on here. Once a quota-enabled GPT-5.4+ OpenAI credential is provided for |
|
Temporary merge-gate adjustment requested by repository owner on 2026-05-27 UTC:
This is a temporary rollback-bound gate adjustment, not a scanner suppression in workflow code. |
Summary
Verification
Summary by CodeRabbit
Bug Fixes
Chores
Tests
critheaders are rejected in both session and OIDC flows.Documentation