jwt-decode
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseJWT Decode
JWT解码
Decode a JWT by base64url-decoding its header and payload. Does NOT verify signatures — use for that.
jwt-validate通过base64url解码JWT的头部和负载来解析JWT。不验证签名——如需验证请使用。
jwt-validateSteps
步骤
- Split the token on into three parts (header, payload, signature).
. - Base64url-decode and parse parts 1 and 2 as JSON.
- Display header, payload (with all claims), and the raw signature string.
- For ,
exp,nbf— show both the Unix timestamp and human-readable UTC. Ifiatis past, note expired and by how long.exp - Run security checks (see below).
- 将令牌按分割为三部分(头部、负载、签名)。
. - 对第1和第2部分进行base64url解码并解析为JSON。
- 显示头部、负载(包含所有声明)以及原始签名字符串。
- 对于、
exp、nbf——同时显示Unix时间戳和人类可读的UTC时间。如果iat已过期,标注已过期并说明过期时长。exp - 运行安全检查(见下文)。
Output Format
输出格式
undefinedundefinedHeader
Header
{ "alg": "RS256", "typ": "JWT", "kid": "abc123" }
{ "alg": "RS256", "typ": "JWT", "kid": "abc123" }
Payload
Payload
{ "iss": "https://auth.example.com/", "sub": "user|12345", "exp": 1735689600 }
exp: 2025-01-01T00:00:00Z — EXPIRED (3 months ago)
iat: 2024-12-31T00:00:00Z
{ "iss": "https://auth.example.com/", "sub": "user|12345", "exp": 1735689600 }
exp: 2025-01-01T00:00:00Z — EXPIRED (3 months ago)
iat: 2024-12-31T00:00:00Z
Signature
Signature
Algorithm: RS256 | Signature: [base64url string]
(Not verified — use jwt-validate to verify)
undefinedAlgorithm: RS256 | Signature: [base64url string]
(Not verified — use jwt-validate to verify)
undefinedSecurity Checks
安全检查
Flag these prominently when found:
- — Token is unsigned. Warn: "This token has no signature and cannot be trusted. Any party could have created or modified it." This is a known attack vector (CVE-2015-9235) where attackers strip signatures to bypass verification.
alg: none - Sensitive data in payload — JWTs are encoded, not encrypted. Warn if you spot passwords, secrets, API keys, or PII in claims.
- Missing — Token never expires. Flag as a security risk.
exp - /
jku/jwkin header — These can be used to trick verifiers into fetching attacker-controlled keys. Flag if present.x5u
当发现以下情况时,显著标记:
- — 令牌未签名。警告:“此令牌无签名,不可信任。任何主体都可能创建或修改它。”这是已知的攻击向量(CVE-2015-9235),攻击者会移除签名以绕过验证。
alg: none - 负载中包含敏感数据 — JWT是编码而非加密的。如果在声明中发现密码、密钥、API密钥或PII(个人身份信息),发出警告。
- 缺少声明 — 令牌永不过期。标记为安全风险。
exp - 头部中包含/
jku/jwk— 这些字段可被用于诱使验证者获取攻击者控制的密钥。如果存在则标记。x5u
Notes
注意事项
- If header is "JWT", the payload is a nested JWT — decode recursively.
cty - On decode failure, report the specific error (malformed base64, invalid JSON, wrong segment count).
- This skill only reveals token contents — it says nothing about authenticity. Direct users to for verification.
jwt-validate
- 如果头部的为“JWT”,则负载是嵌套JWT——需递归解码。
cty - 解码失败时,报告具体错误(格式错误的base64、无效JSON、段数错误)。
- 本技能仅展示令牌内容——不涉及真实性验证。引导用户使用进行验证。
jwt-validate