OWASP Cheat Sheet: JSON Web Token Cheat Sheet / GUIDANCE

JSON Web Token Cheat Sheet

This cheat sheet provides tips to prevent common security issues when using JSON Web Tokens (JWT). JSON Web Tokens (JWT) are security tokens for carrying information (claims), often about a user, an application, etc. (subject). JWTs can provide authenticity of the claims (signed JWT) and/or confidentiality of the claims (encrypted JWT). In addition, JWT defines standard claims. JWTs are used in a wide range of applications such as: - In OpenID Connect, the ID token is a JWT used to represent the identity and attributes of the connected user. - In OAuth 2, the access token used to obtain access to a protected resource can be a JWT. - A JWT is often suggested for “stateless” user sessions. However, this usage is frowned upon. - A DPoP Proof JWT can be used to prove possession of a private key. - In SPIFFE, a JWT-SVID can be used to authenticate a workload. In its most common form (signed JWT), this information is protected by the generating application (issuer) using a signature to ensure it has not been tampered with. This signature prevents attackers, such as a malicious client or user, from forging a token or modifying the claims in an existing token, for example changing the user role from a simple user to an admin or altering the client's login. The JWT can be seen as a protected identity card or certificate about a user, an application, etc. An application (presenter) presents the token to a consuming application (audience) which can verify the token's authenticity and validity and take decisions or actions based on these claims. JWT can also provide confidentiality of the claims (encrypted JWT). Encryption itself is only introduced briefly in Token Confidentiality and JWE, but many aspects of this cheat sheet also apply to encrypted JWTs.

Category
OWASP API
Version / scope
OWASP Cheat Sheet Series; commit 7af0ef1b745f1a38ce905c00c5a592d5b3a515a9
Affected / relevant technologies
Web applications / APIs
Evidence
Documentation: pinned-source excerpt checked. Execution: not tested. Editorial: curated reference.

Defensive analysis and explicitly authorized assessment only. This website performs no scans, exploitation, model calls or infrastructure changes. Indicators below are investigation opportunities, not proof of compromise or guaranteed detectors.

Mechanism and prerequisites

Match the design and deployment assumptions in the cited revision. Use authorized review evidence; do not send production secrets to test systems.

Potential impact

This is preventive engineering guidance, not a new Top 10 risk, a CVE or proof of an exploitable deployment.

Versioned source scope

This record contains normalized, sometimes shortened source excerpts with editorial safety context. Markup and executable example blocks are omitted. Source-field verification does not establish device testing, a working detector or local applicability.

Publisher: OWASP. Release: OWASP Cheat Sheet Series; commit 7af0ef1b745f1a38ce905c00c5a592d5b3a515a9. Source checked: 2026-11-18.

Source object: OWASP Cheat Sheet: JSON Web Token Cheat Sheet.

Attribution and source terms (OWASP contributors · CC BY-SA 4.0)

Detection and investigation

Preserve source timestamps, asset identity and collection context. Correlate independent evidence before attributing malicious intent. In OT, review passive evidence with the process owner; do not induce failures, replay commands or write to controllers to test a hypothesis.

Mitigation and response

Apply changes through the asset owner's approved change and recovery process. Documentation review is separate from successful testing or verified production protection.

Related technical context

No protocol-specific mapping is asserted for this entry.

Related security reading

Continue directly to another reference. Editorial reading connections do not assert official CWE/CAPEC/ATT&CK/OWASP equivalence or mappings.

Authoritative sources and attribution

Identifiers and source titles belong to OWASP, MITRE, the CVE Program, CISA, NIST or the cited vendor. Source excerpts are attributed and adapted under the linked publisher license; editorial context is separate. This is not an official framework mirror. Review baseline: 2026-11-18. Live documents can change; check exact current applicability.

Source review supports bounded reference text. It is not execution evidence, a completeness claim, a CVSS assessment, a compliance certification or verification of production security.