unstale

npm / jose

jose

What changed in jose 5 to 6, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-30.

54 breaking10 security8 new APIs and options2 behavior and defaults2 tooling31 fixes and other

See which of these apply to your code, ranked, in your agent:

npx @unstale/cli init

@unstale/cli on npm

jose 695 changes

Breaking changes 46

  • Direct AKP key inputs now require alg.

    6.2.18release notes

  • Negative maxTokenAge values are now rejected.

    6.2.17release notes

  • Mixed b64 modes are rejected for empty General JWS payloads.

    6.2.10release notes

  • Mixed payload encoding modes are rejected.

    6.2.10release notes

  • Empty protected headers and JWE AAD members are rejected.

    6.2.10release notes

  • Verification key metadata is enforced.

    6.2.10release notes

  • JWT verification policies must be explicit.

    6.2.10release notes

  • EmbeddedJWK now rejects a non-string alg value.

    6.2.8release notes

  • Decryption now enforces a single recipient for dir and ECDH-ES algorithms.

    6.2.8release notes

  • Presence checks now require properties owned by the JOSE object.

    6.2.7release notes

  • Truncated ASN.1 key data is rejected.

    6.2.5release notes

  • Characters outside the Base64URL alphabet are rejected.

    6.2.5release notes

  • Duplicate crit values are rejected when producing JOSE objects.

    6.2.5release notes

  • Rejects a crv option that is not implied by the selected algorithm.

    6.2.5release notes

  • Invalid UTF-8 is rejected in JOSE Headers and JWT Claims Sets.

    6.2.5release notes

  • Unencoded payloads are rejected when using JWS Compact Serialization.

    6.2.5release notes

  • Non-ASCII token segments now produce JOSE errors.

    6.2.5release notes

  • Failed decompression is now rejected with a JWEInvalid error.

    6.2.2release notes

  • CJS-style require works only when the Node.js runtime supports require(esm).

    6.0.0release notes

  • The Node.js-only agent option has been removed because createRemoteJWKSet now uses fetch.

    6.0.0release notes

  • The deriveKey usage is no longer supported.

    6.0.0release notes

  • The (un)wrapKey usage is no longer supported.

    6.0.0release notes

  • Deprecated experimental APIs have been removed.

    6.0.0release notes

  • Support for Ed448 has been dropped.

    6.0.0release notes

  • All builds and bundles now target ES2022.

    6.0.0release notes

  • In Node.js, generateKeyPair now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • In Node.js, generateSecret now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • In Node.js, importJWK now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • In Node.js, importPKCS8 now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • In Node.js, importSPKI now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • In Node.js, importX509 now yields a CryptoKey instead of a KeyObject.

    6.0.0release notes

  • The runtime-specific package is no longer maintained or supported.

    6.0.0release notes

  • The runtime-specific package is no longer maintained or supported.

    6.0.0release notes

  • The extractable default for public keys imported from JWK is now true.

    6.0.0release notes

  • Support for JWK key_ops has been dropped.

    6.0.0release notes

  • Key Type Generics have been removed.

    6.0.0release notes

  • PEMImportOptions has been renamed to KeyImportOptions, so update type references.

    6.0.0release notes

  • Node.js 18.x and earlier are no longer supported.

    6.0.0release notes

  • The extractable default for public keys imported from PEM is now true.

    6.0.0release notes

  • Private KeyObject instances can no longer be used for verify operations.

    6.0.0release notes

  • Private KeyObject instances can no longer be used for encryption operations.

    6.0.0release notes

  • Keys returned by verify/decrypt operations using get key functions are always normalized to Uint8Array or CryptoKey, depending on the operation.

    6.0.0release notes

  • RSA1_5 JWE support has been removed.

    6.0.0release notes

  • secp256k1 JWS support has been removed.

    6.0.0release notes

  • WebCryptoAPI is now the only crypto used.

    6.0.0release notes

  • Support for X448 has been dropped.

    6.0.0release notes

Security 10

  • Negative JWT clockTolerance values are rejected.

    6.2.15release notes

  • JWE decompression is canceled when output exceeds the limit.

    6.2.15release notes

  • AES-GCM tag boundaries are enforced.

    6.2.10release notes

  • DER truncated past its outer length is rejected.

    6.2.10release notes

  • The ext and key_ops parameters are validated.

    6.2.10release notes

  • Protected headers cannot be replaced.

    6.2.10release notes

  • Unencoded payload strings are validated.

    6.2.10release notes

  • Unsecured protected headers are validated.

    6.2.10release notes

  • JWE objects with colliding generated Key Management Parameters are now rejected.

    6.2.9release notes

  • Invalid PBES2 p2c values are now cleanly rejected.

    6.2.3release notes

New APIs and options 5

  • Discriminated JOSE error types are available for more precise TypeScript error handling.

    6.2.5release notes

  • Re-introduces support for the JWE zip (Compression Algorithm) Header Parameter.

    6.2.0release notes

  • setKeyManagementParameters is now exposed on a GeneralEncrypt Recipient.

    6.1.1release notes

  • New fetch-related options are available now that createRemoteJWKSet uses fetch.

    6.0.0release notes

  • JSON Web Key is now an allowed input everywhere.

    6.0.0release notes

Behavior and default changes 1

  • CryptoKey and KeyObject inputs are now enabled in JWK thumbprint functions.

    6.0.0release notes

Tooling 2

  • JOSE identifier unions and JWK narrowing improve TypeScript type precision.

    6.2.5release notes

  • JWK narrowing improves TypeScript type precision.

    6.2.5release notes

Fixes and other changes 31

  • JWT handling now accepts mixed-case ago suffixes.

    6.2.18release notes

  • Headers are preserved when claims are replicated.

    6.2.18release notes

  • Errors are preserved when compression streams are unavailable.

    6.2.18release notes

  • Timeouts while reading the response body are now reported.

    6.2.18release notes

  • Invalid options are now exposed in general JWS and JWE.

    6.2.16release notes

  • Negative JWKS cache durations are rejected.

    6.2.15release notes

  • Preserves contextual inference for JWT payloads, so TypeScript can retain payload types in context.

    6.2.14release notes

  • Underlying error causes are now preserved, allowing developers to retain the original cause when handling errors.

    6.2.13release notes

  • Builder claim values are validated.

    6.2.10release notes

  • Invalid decrypted CEK lengths are concealed.

    6.2.10release notes

  • Invalid duration inputs are rejected.

    6.2.10release notes

  • Explicit encryption parameters are validated.

    6.2.10release notes

  • Key generation and import options are validated.

    6.2.10release notes

  • Key resolution inputs are normalized.

    6.2.10release notes

  • Empty octet-sequence keys are accepted.

    6.2.10release notes

  • Invalid remote duration values are rejected.

    6.2.10release notes

  • Overlapping remote reloads are ordered.

    6.2.10release notes

  • Serialization members are consumed only once.

    6.2.10release notes

  • Serialized header values are validated.

    6.2.10release notes

  • The PBES2 p2c parameter is no longer deprecated in the type definitions.

    6.2.9release notes

  • Type declarations now accept host CryptoKey declarations.

    6.2.6release notes

  • The clockTolerance option is validated to ensure it is finite.

    6.2.5release notes

  • CryptoKey types are corrected for more accurate TypeScript usage.

    6.2.5release notes

  • The currentDate option is validated to ensure it is finite.

    6.2.5release notes

  • Claim values are compared correctly when validation options are falsy.

    6.2.5release notes

  • JWE processing now handles additional authenticated data with zero length.

    6.2.5release notes

  • Key management parameters are forwarded correctly when a JWE has a single recipient.

    6.2.5release notes

  • JWK types are corrected for more accurate TypeScript usage.

    6.2.5release notes

  • JWT header types are corrected for more accurate TypeScript usage.

    6.2.5release notes

  • Key and result type inference is improved for TypeScript consumers.

    6.2.5release notes

  • Key resolver types are corrected for more accurate TypeScript usage.

    6.2.5release notes

jose 512 changes

Breaking changes 8

  • In Node.js, base64url.decode returns a Uint8Array instead of a Buffer.

    5.0.0release notes

  • The browser distribution is now built using ES2020 as a target.

    5.0.0release notes

  • For oct JWK key types, importJWK always returns a Uint8Array formed from the k parameter, regardless of other JWK parameters.

    5.0.0release notes

  • JWT producing constructors now default to an empty payload.

    5.0.0release notes

  • Decrypt functions now require the keyManagementAlgorithms option to explicitly opt in to using PBES2 key management algorithms.

    5.0.0release notes

  • End-of-Life Node.js versions are no longer supported; Node.js 18, 20, 21, and future releases remain supported.

    5.0.0release notes

  • The importJWK option was removed; importJWK no longer returns CryptoKey or KeyObject for oct JWKs.

    5.0.0release notes

  • The JWE zip compression header parameter is no longer supported.

    5.0.0release notes

New APIs and options 3

  • jwtDecrypt has an optional KeyLike resolved type argument as a second type argument, following the JWT Claims Set type.

    5.0.0release notes

  • jwtVerify has an optional KeyLike resolved type argument as a second type argument, following the JWT Claims Set type.

    5.0.0release notes

  • Timestamp setting functions now accept Date as valid input.

    5.0.0release notes

Behavior and default changes 1

  • The Node.js distribution is now built using ES2022 as a target.

    5.0.0release notes