Treat it as untrusted input. A parsed token may expose claims, but it does not prove the issuer, signature, audience, or expiry are valid. Security teams should reject any design that uses payload values for authorisation before verification succeeds, because that turns a bearer credential into an unauthenticated assertion.
Why a Successfully Parsed JWT Still Cannot Be Trusted
A JWT can be decoded, parsed, and rendered into claims before it has been verified, but that only proves the token is syntactically valid JSON Web Token structure. The security decision still depends on cryptographic verification, issuer trust, audience checking, and expiry validation. Until those checks pass, the token is only data, not an authenticated statement.
That distinction matters because the payload is easy to read and easy to misuse. Teams should design every code path so that parsing is treated as a preprocessing step, not as evidence that the token came from a trusted source or that the claims are safe for access decisions.
For teams building service-to-service flows, this same rule applies to any bearer credential that can be decoded before it is validated. A parsed token may be useful for logging, routing, or error handling, but it must never become the basis for authorisation or identity decisions before verification succeeds. For workload-oriented patterns, the Guide to SPIFFE and SPIRE gives a useful adjacent model for treating workload assertions as trustworthy only after the underlying identity proof is established.
What Verification Must Establish Before Claims Are Actionable
Verification is the step that converts a token from an unreadable string into a trusted security artifact. At minimum, the implementation must confirm the signature or MAC, confirm the token was issued by the expected issuer, and check that the audience matches the intended service. Expiry, not-before, and replay-related conditions also matter because a well-formed token can still be stale, stolen, or simply meant for a different context.
Teams often miss that these checks are not interchangeable. A token can be correctly signed and still be wrong for the application if the audience is too broad. It can also be current and correctly targeted but still unusable if the issuer is not trusted by the relying service. The Token and Session Security Guide is a strong companion for the lifetime, revocation, binding, and replay side of this problem.
In practice, the safest sequence is to verify first, then map claims to policy, then authorise the requested action. Any shortcut that treats decoded claims as facts creates a bearer-token trust failure, because the application is accepting an assertion before it has established who made it and whether it applies here.
The verification step is also where teams decide how strictly to fail. If a required claim is missing, malformed, or untrusted, the correct behaviour is to reject the token and log the reason. Trying to “be helpful” by falling back to whatever claims are present is how unauthenticated input becomes an access decision.
How to Build Safe JWT Handling Into Application and API Flows
Implementation should separate token parsing, verification, and authorisation into explicit stages. That keeps developers from reaching into the decoded payload too early, and it makes code review easier because the trust boundary is visible. When a parsed token is used for UI hints, diagnostics, or request correlation, it should be handled as untrusted input exactly the way any other client-supplied field would be.
For APIs, the key design rule is that claims influence access only after verification succeeds and policy evaluation confirms the request is allowed. This is closely aligned with the concern behind the OWASP API Security Top 10, especially when broken authorisation or broken authentication can be triggered by accepting unverified assertions.
Operationally, teams should also verify that libraries and gateways fail closed. A common implementation flaw is to decode a token for convenience, then skip verification because another component “already checked it” or because the token appears well formed. The right control is to make the verification result a hard gate, not an advisory signal.
When tokens represent service or workload access, rotate signing material and review trust assumptions with the same discipline used for other credentialed systems. The NIST SP 800-57 Key Management guidance is useful where token trust depends on signing key lifecycle, while the Microsoft Storm-0558 key breach 2023 is a reminder that token validation is only as strong as the protection and rotation of the signing keys behind it.
Risk and Threat Considerations
Using claims from an unverified JWT turns attacker-controlled data into an access-control input. That can lead to privilege escalation, tenant confusion, impersonation, or acceptance of a token that was forged, tampered with, expired, or minted for a different audience.
Failure mechanism: The application decodes the token, trusts fields like subject, role, or scope before verification succeeds, and then makes an allow decision on the basis of those claims. An attacker only needs to supply a syntactically valid but untrusted token to influence the decision path.
Impact: The service may grant access, expose data, or route a request as if the caller were authenticated, even though no trustworthy issuer relationship has been established. In the worst case, a single unverified claim can become a full account or workload impersonation path.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP API Security Top 10 addresses the attack surface, NIST SP 800-53 Rev 5, NIST SP 800-57 and CIS Controls v8 set the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP API Security Top 10 | API2 — Broken Authentication | Unverified JWT handling is an authentication failure path. |
| Recommendation — Reject token-derived identity until signature, issuer, and audience checks pass. | ||
| NIST SP 800-53 Rev 5 | IA-5 — Authenticator Management | JWTs depend on token and signing-key lifecycle controls. |
| IA-2 — Identification and Authentication (Organizational Users) | Access decisions based on JWT claims require verified authentication first. | |
| IA-9 — Identification and Authentication (Non-Organizational Users) | JWTs often authenticate external callers, APIs, and services. | |
| Recommendation — Enforce token and key lifecycle controls that fail closed on unverified input. Require authenticated identity before any claim can drive access decisions. Verify external and service tokens before trusting asserted claims. | ||
| NIST SP 800-57 | Key Management | JWT trust depends on signing-key generation, rotation, and retirement. |
| Recommendation — Rotate signing keys on a managed cryptoperiod and retire compromised keys quickly. | ||
| CIS Controls v8 | CIS-6 — Access Control Management | Verified claims must be the basis for access control, not decoded payloads. |
| Recommendation — Use verified token claims only after access control decisions are enforced. | ||
| ISO/IEC 27001:2022 | A.8.24 — Use of cryptography | JWT verification relies on cryptographic protection and validation. |
| Recommendation — Protect and validate cryptographic mechanisms that secure token integrity. | ||
Practitioner Guidance
What to verify: Ensure every code path has an explicit verification gate before any claim is used for authorisation, tenancy, or identity mapping. Audit framework and middleware defaults, because “decode then inspect” is acceptable only when the inspected values cannot change access decisions.
Common mistake: Treating a parsed token as “mostly valid” and then cherry-picking claims for convenience. If the token can affect privilege, routing, or trust decisions, it must be verified first or discarded.
What good looks like: Parsing is used only to read untrusted structure, verification is mandatory and fail-closed, and every authorisation decision is derived from verified claims plus local policy, not from the payload alone.
Practitioner takeaway: A decoded JWT is not an identity proof, it is only a candidate assertion, and any design that acts on it before verification has already crossed the trust boundary.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 7, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org