Skip to content

Conversation

@AL-Cybision
Copy link
Contributor

Summary

  • Integrity: Reject ‘crit’ in unprotected headers during JSON serialize/deserialize (RFC 7515 §4.1.11).
  • Type: Require ‘crit’ to be an array of strings; invalid types raise.
  • Scope: Validate ‘crit’ only against the protected header in JSON serialization.
  • Refactor: Add _reject_unprotected_crit(...) to centralize the unprotected check.
  • Tests: Add coverage for unprotected ‘crit’ rejection and type enforcement.
  • Compatibility: No behavior change for valid tokens; only malformed inputs now fail earlier.
  • Note: Does not change recognition/presence logic from the existing fix branch.
  • Files changed:
    authlib/authlib/jose/rfc7515/jws.py
    authlib/tests/jose/test_jws.py
  • Validation:
    • tests/jose/test_jws.py passes locally.
    • Also All tests ran in tests direcotry 753 passed, 1 skipped in 33.21s.

AL-Cybision and others added 5 commits September 14, 2025 11:50
…rit' semantics

RFC 7515 §4.1.11 compliance: reject 'crit' in unprotected header; validate type, recognition, and presence for protected 'crit'.
@lepture lepture merged commit 55e8517 into authlib:fix-jose-crit Sep 14, 2025
1 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants