algorithm allow list
The fixed set of signing algorithms a verifier accepts, chosen by server policy rather than by the alg field of the token.
Trusting the token-chosen algorithm can let forged tokens verify.
In more detail
Letting the token choose its own algorithm enables attacks such as alg none, or verifying an HMAC with a public key as its secret. Configure the allowed list on the verifier and reject every token whose header names anything else.
Example
In the APIs course: The course service accepts only HS256.Related terms
- JSON Web Token — A compact signed token made of three base64url parts separated by dots: a header, a payload of claims and a signature.
- key identifier — A short name in a token header, kid, that says which of the verifier’s trusted keys was used to sign it.
- deny by default — The rule that anything not explicitly allowed is refused, including when the facts needed to decide are missing.
Taught in
- JSON Web Tokens — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC