Reject platform admin HMAC sessions - #306
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 (5)
📝 WalkthroughWalkthroughThis PR tightens JWT authentication security by preventing legacy HMAC-signed sessions from granting platform-wide administrative roles. A new payload validation gate rejects ChangesHMAC system-admin boundary enforcement
Possibly related PRs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 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 |
Summary
system_adminandplatform_adminclaims on the legacy HMAC fallback session pathEvidence
26641767705reportedJWT Authentication Bypass via HMAC Secret Disclosure, specifically forgedsystem_adminclaims whenAUTH_SESSION_HMAC_SECRETis known.backend/.env; the remaining defensible fix is to reduce HMAC fallback blast radius so platform-wide roles cannot be minted through a symmetric session secret.Verification
PYTHONDONTWRITEBYTECODE=1 python3 -m pytest backend/tests/test_auth_real.py backend/tests/test_accounts_api.py backend/tests/test_observability_api.py backend/tests/test_security_api.py backend/tests/test_data_api.py backend/tests/test_ai_hub_api.py backend/tests/test_tasks_api.py -qPYTHONDONTWRITEBYTECODE=1 python3 -m pytest backend/tests -qPYTHONDONTWRITEBYTECODE=1 python3 -m bandit -r backend/ -x backend/tests/ -qgit diff --checkNotes
Summary by CodeRabbit
Bug Fixes
Documentation