The token that opts into trust
A missing verification key silently opts a verifier into accepting unsigned input.
What’s going wrong
Input is an array of at most 100 policy rows {alg, key, signed, signatureValid, algorithms?}. alg is none, HS256 or RS256. key is secret, public or null. signed and signatureValid are booleans produced by a simulated trusted cryptographic layer; this exercise does not verify real JWTs. When algorithms is absent, secret permits only HS256, public permits only RS256, and null permits nothing. An explicit algorithms array replaces defaults, including an explicitly empty array. none is accepted only when explicitly allowed, key is null and signed is false. HS256 requires a secret key; RS256 requires a public key; either also requires signed and signatureValid. Return boolean decisions. Explicit none is retained only to model an intentional compatibility option.
Expected behavior
Require explicit policy before accepting unsigned input.
Reproduction
[{"alg":"none","key":null,"signed":false,"signatureValid":false}][false]
[{"alg":"HS256","key":"secret","signed":true,"signatureValid":true}][true]
[{"alg":"none","key":null,"signed":false,"signatureValid":false,"algorithms":["none"]}][true]
Before you begin
- TypeScript unions and optional properties
- Authentication policy versus cryptographic verification
Need a nudge?
Reveal one investigation hint at a time. Try each clue before opening the next.
Read the report, then sign in to start your investigation.