The Real Fullstack

The Unverified Token

Tokens come from the identity provider. Why would anyone need to check them again?

工程师8 分钟代码挑战流程模拟器
jwtoauth2spring-securitynode

此挑战尚未翻译为简体中文,你正在阅读英文版本。

任务:Select the verification steps that accept every legitimate token and reject every forged, expired or misdirected one.背景 · 学习目标 ▾

Wrenly's orders API trusted the JWT payload after base64-decoding it: the gateway was supposed to verify tokens, but internal traffic bypasses the gateway. Security found edited tokens, alg:none tokens and tokens issued for another API in the access logs.

任务: Select the verification steps that accept every legitimate token and reject every forged, expired or misdirected one.

学习目标

  • Know what decoding vs verifying a JWT means.
  • Pin the algorithm and validate exp, iss and aud.
  • Avoid authorization rules based on untrusted claims.
模拟模拟数据
clientidentity providerorders APIorders DB
运行模拟
// current: decodes the payload and trusts itconst claims = JSON.parse(Buffer.from(token.split('.')[1], 'base64url'));req.user = claims;

简化说明

Seven tokens with fixed properties. Real verification also handles key rotation (JWKS) and clock skew. 教学模型——数字用于说明行为,并非基准测试。

概念

建议先完成

相关挑战

参考资料