JWT critical header parameter (`crit`): reject unsupported extensions
The JWS `crit` header lists JOSE header extensions that a verifier must understand and process. If the verifier does not support even one listed extension, it must reject the JWS as invalid. A signature check alone is not enough: ignoring `crit` can accept a token without applying security semantics the issuer marked as mandatory.
JWT critical header parameter (crit): reject unsupported extensions
The JWS crit header lists JOSE header extensions that a verifier must understand and process. If the verifier does not support even one listed extension, it must reject the JWS as invalid. A signature check alone is not enough: ignoring crit can accept a token without applying security semantics the issuer marked as mandatory.
This article covers crit in the protected JOSE header of JSON Web Signature (JWS, RFC 7515). Some JWT profiles do not allow arbitrary header extensions, so apply the rules of the specific profile, including OIDC or OAuth access-token rules.
Processing rules
Parse the JSON header safely. Reject duplicate header parameter names, or follow a consistent JSON handling rule permitted by RFC 7515.
If `crit` is present, require a non-empty array.
Each entry must be a unique string naming an extension that is also present in the protected JOSE header.
Do not list JWS header parameters defined by RFC 7515 or JWA as extensions in `crit`; duplicate names are invalid.
Understand and process every listed extension according to its specification. If any extension is unsupported or the combination is invalid, reject the token regardless of the signature result.
After extension processing and signature verification, check profile requirements such as issuer, audience, expiration, token type, and application authorization.
For example, this header illustrates a hypothetical critical exp extension. Checking the JWT payload's exp claim is different from processing this hypothetical JOSE header extension. Unless a separate profile defines it and the verifier supports it, reject this example. It is not a ready-to-use configuration.
{"alg":"ES256","crit":["exp"],"exp":1363284000}Common mistakes
**Always ignoring `crit`:** this skips required extension semantics and changes the validation the specification requires.
**Logging an unknown extension and accepting the token:** a warning is not a substitute for rejection. Under RFC 7515, a JWS with an unsupported critical extension is invalid.
**Always rejecting or accepting extra headers not listed in `crit`:** follow the critical-extension rules and the token profile. Policy for unknown non-critical headers is profile-specific.
**Treating a valid signature as full validity:** `crit` processing and issuer, audience, time, and token-purpose checks are all required.
References
IETF, [RFC 7515 §4.1.11: `crit`](https://www.rfc-editor.org/rfc/rfc7515.html#section-4.1.11)
IETF, [RFC 7515 Appendix E: Negative Test Case for `crit`](https://www.rfc-editor.org/rfc/rfc7515.html#appendix-E)
IETF, [RFC 8725: JSON Web Token Best Current Practices](https://www.rfc-editor.org/rfc/rfc8725.html)