jose 6
Last reviewed Oct 22, 2026
Prompt Details
Prompt Composition
2prompts
- JavaScript ES2026102 lines · 3.1K tokens
- jose 667 lines · 3K tokens
Total169 lines · 6.1K tokens
CWE Coverage
- 20
- 79
- 89
- 95
- 117
- 201
- 208
- 209
- 287
- 295
- 323
- 327
- 338
- 345
- 346
- 347
- 352
- 362
- 400
- 409
- 459
- 471
- 494
- 502
- 522
- 532
- 602
- 613
- 636
- 770
- 807
- 829
- 838
- 862
- 916
- 918
- 922
- 943
- 1004
- 1321
- 1333
Prompt Preview
Apply the JavaScript ES2026 prompt first. These rules cover jose 6's universal ESM APIs for JWT, JWS, JWE, and JWK processing. Confirm Web Crypto and Fetch support, including the selected algorithms, in the deployed runtime. When running on Node.js, also apply the Node.js prompt for the installed version.
JWT verification profiles
- Use
jwtVerifyfor signed JWTs andjwtDecryptfor encrypted JWT claims.compactVerify,generalVerify, andcompactDecrypthandle JOSE messages without supplying JWT claim validation; decoding withdecodeJwtordecodeProtectedHeaderestablishes no trust. - Pass an explicit
algorithmsallowlist tojwtVerifyand direct JWS verification APIs. Their default accepts every applicable algorithm for the key; keep symmetric and asymmetric verification policies separate and never derive the policy from the receivedalg. - Supply the expected
issuerandaudience, and requireexpthroughrequiredClaims. Claim validation does not make every registered claim mandatory; require the claims the endpoint's token profile needs. - Set
maxTokenAgewhen token age matters, which also requiresiat, and a small explicitclockTolerance. KeepcurrentDateunder trusted clock/test control; never let a request choose the verification time. - Set the profile's expected
typand use separate validation rules for ID tokens, access tokens, refresh tokens, and other signed objects. Do not accept an ID token at an API merely because the same issuer signed it. - Validate application claims in the verified
payloadbefore using scopes, roles,