jose 6

Last reviewed Oct 22, 2026

Export as PDF

Prompt Details

Prompt Composition

2prompts
  1. JavaScript ES2026102 lines · 3.1K tokens
  2. 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 jwtVerify for signed JWTs and jwtDecrypt for encrypted JWT claims. compactVerify, generalVerify, and compactDecrypt handle JOSE messages without supplying JWT claim validation; decoding with decodeJwt or decodeProtectedHeader establishes no trust.
  • Pass an explicit algorithms allowlist to jwtVerify and 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 received alg.
  • Supply the expected issuer and audience, and require exp through requiredClaims. Claim validation does not make every registered claim mandatory; require the claims the endpoint's token profile needs.
  • Set maxTokenAge when token age matters, which also requires iat, and a small explicit clockTolerance. Keep currentDate under trusted clock/test control; never let a request choose the verification time.
  • Set the profile's expected typ and 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 payload before using scopes, roles,