Skip to content

Update dependency jsonwebtoken to v9#12

Open
dev-mend-for-github-com[bot] wants to merge 1 commit intomainfrom
whitesource-remediate/jsonwebtoken-9.x
Open

Update dependency jsonwebtoken to v9#12
dev-mend-for-github-com[bot] wants to merge 1 commit intomainfrom
whitesource-remediate/jsonwebtoken-9.x

Conversation

@dev-mend-for-github-com
Copy link
Copy Markdown

@dev-mend-for-github-com dev-mend-for-github-com bot commented Jan 12, 2025

ℹ️ Note

This PR body was truncated due to platform limits.

This PR contains the following updates:

Package Type Update Change
jsonwebtoken dependencies major 0.4.09.0.0

By merging this PR, the issue #6 will be automatically resolved and closed:

Severity CVSS Score Vulnerability Reachability
Critical Critical 9.8 CVE-2015-9235
Medium Medium 6.4 CVE-2022-23540
Medium Medium 5.9 CVE-2022-23539
Medium Medium 5.0 CVE-2022-23541

Release Notes

auth0/node-jsonwebtoken (jsonwebtoken)

v9.0.0

Compare Source

Breaking changes: See Migration from v8 to v9

Breaking changes
  • Removed support for Node versions 11 and below.
  • The verify() function no longer accepts unsigned tokens by default. ([8345030]8345030)
  • RSA key size must be 2048 bits or greater. ([ecdf6cc]ecdf6cc)
  • Key types must be valid for the signing / verification algorithm
Security fixes
  • security: fixes Arbitrary File Write via verify function - CVE-2022-23529
  • security: fixes Insecure default algorithm in jwt.verify() could lead to signature validation bypass - CVE-2022-23540
  • security: fixes Insecure implementation of key retrieval function could lead to Forgeable Public/Private Tokens from RSA to HMAC - CVE-2022-23541
  • security: fixes Unrestricted key type could lead to legacy keys usage - CVE-2022-23539

v8.5.1

Compare Source

Bug fix
Docs

v8.5.0

Compare Source

New Functionality
Test Improvements
Docs

v8.4.0

Compare Source

New Functionality
Bug Fixes
Docs
Test Improvements
CI

v8.3.0

Compare Source

v8.2.2

Compare Source

v8.2.1

Compare Source

v8.2.0

Compare Source

v8.1.1

Compare Source

v8.1.0

Compare Source

v8.0.1

Compare Source

v8.0.0

Compare Source

Breaking changes: See Migration notes from v7

v7.4.3

Compare Source

  • Fix breaking change on 7.4.2 for empty secret + "none" algorithm (sync code style) (PR 386)

v7.4.2

Compare Source

  • Fix breaking change on 7.4.2 for empty secret + "none" algorithm (sync code style) (PR 386)

v7.4.1

Compare Source

v7.4.0

Compare Source

v7.3.0

Compare Source

v7.2.1

Compare Source

v7.2.0

Compare Source

v7.1.10

Compare Source

v7.1.9

Compare Source

v7.1.8

Compare Source

v7.1.7

Compare Source

v7.1.6

Compare Source

v7.1.5

Compare Source

v7.1.3

Compare Source

v7.1.1

Compare Source

v7.1.0

Compare Source

v7.0.1

Compare Source

v7.0.0

Compare Source

v6.2.0

Compare Source

v6.1.2

Compare Source

v6.1.1

Compare Source

v6.1.0

Compare Source

v6.0.1

Compare Source

This was an immediate change after publishing 6.0.0.

v6.0.0

Compare Source

v5.7.0

Compare Source

v5.6.2

Compare Source

v5.6.0

Compare Source

v5.5.4

Compare Source

v5.5.3

Compare Source

v5.5.2

Compare Source

v5.5.1

Compare Source

v5.5.0

Compare Source

v5.4.1

Compare Source

v5.4.0

Compare Source

v5.3.1

Compare Source

v5.2.0

Compare Source

v5.1.0

Compare Source

v5.0.5

Compare Source

v5.0.4

Compare Source

v5.0.3

Compare Source

v5.0.2

Compare Source

v5.0.1

Compare Source

v5.0.0

Compare Source

Changed
  • [sign] Only set defautl iat if the user does not specify that argument.

e900282
35036b1
954bd7a
24a3700
a77df6d

Security
  • [verify] Update to jws@^3.0.0 and renaming header.alg mismatch exception to invalid algorithm and adding more mismatch tests.

As jws@3.0.0 changed the verify method signature to be jws.verify(signature, algorithm, secretOrKey), the token header must be decoded first in order to make sure that the alg field matches one of the allowed options.algorithms. After that, the now validated header.alg is passed to jws.verify

As the order of steps has changed, the error that was thrown when the JWT was invalid is no longer the jws one:

{ [Error: Invalid token: no header in signature 'a.b.c'] code: 'MISSING_HEADER', signature: 'a.b.c' }

That old error (removed from jws) has been replaced by a JsonWebTokenError with message invalid token.

Important: versions >= 4.2.2 this library are safe to use but we decided to deprecate everything < 5.0.0 to prevent security warnings from library node-jws when doing npm install.

634b8ed
9f24ffd
19e6cc6
1e46234
954bd7a
24a3700
a77df6d

v4.2.2

Compare Source

Fixed
  • [asymmetric-keys] Fix verify for RSAPublicKey formated keys (jfromaniello - awlayton)
    4027946
    8df6aab

v4.2.1

Compare Source

Fixed
  • [asymmetric-keys] Fixed issue when public key starts with BEING PUBLIC KEY (#​70) (jfromaniello)
    7017e74

v4.2.0

Compare Source

Security
  • [asymmetric-keys] Making sure a token signed with an asymmetric key will be verified using a asymmetric key.
    When the verification part was expecting a token digitally signed with an asymmetric key (RS/ES family) of algorithms an attacker could send a token signed with a symmetric algorithm (HS* family).

The issue was caused because the same signature was used to verify both type of tokens (verify method parameter: secretOrPublicKey).

This change adds a new parameter to the verify called algorithms. This can be used to specify a list of supported algorithms, but the default value depends on the secret used: if the secretOrPublicKey contains the string BEGIN CERTIFICATE the default is [ 'RS256','RS384','RS512','ES256','ES384','ES512' ] otherwise is [ 'HS256','HS384','HS512' ]. (jfromaniello)
c2bf7b2
1bb584b

@dev-mend-for-github-com dev-mend-for-github-com bot added the security fix Security fix generated by Mend label Jan 12, 2025
@dev-mend-for-github-com dev-mend-for-github-com bot changed the title chore(deps): update dependency jsonwebtoken to v9 Update dependency jsonwebtoken to v9 Feb 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

security fix Security fix generated by Mend

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants