Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency jsonwebtoken to v9 [SECURITY] #3630

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Oct 4, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
jsonwebtoken ^8.5.1 -> ^9.0.0 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-23539

Overview

Versions <=8.5.1 of jsonwebtoken library could be misconfigured so that legacy, insecure key types are used for signature verification. For example, DSA keys could be used with the RS256 algorithm.

Am I affected?

You are affected if you are using an algorithm and a key type other than the combinations mentioned below

Key type algorithm
ec ES256, ES384, ES512
rsa RS256, RS384, RS512, PS256, PS384, PS512
rsa-pss PS256, PS384, PS512

And for Elliptic Curve algorithms:

alg Curve
ES256 prime256v1
ES384 secp384r1
ES512 secp521r1

How do I fix it?

Update to version 9.0.0. This version validates for asymmetric key type and algorithm combinations. Please refer to the above mentioned algorithm / key type combinations for the valid secure configuration. After updating to version 9.0.0, If you still intend to continue with signing or verifying tokens using invalid key type/algorithm value combinations, you’ll need to set the allowInvalidAsymmetricKeyTypes option to true in the sign() and/or verify() functions.

Will the fix impact my users?

There will be no impact, if you update to version 9.0.0 and you already use a valid secure combination of key type and algorithm. Otherwise, use the allowInvalidAsymmetricKeyTypes option to true in the sign() and verify() functions to continue usage of invalid key type/algorithm combination in 9.0.0 for legacy compatibility.

CVE-2022-23541

Overview

Versions <=8.5.1 of jsonwebtoken library can be misconfigured so that passing a poorly implemented key retrieval function (referring to the secretOrPublicKey argument from the readme link) will result in incorrect verification of tokens. There is a possibility of using a different algorithm and key combination in verification than the one that was used to sign the tokens. Specifically, tokens signed with an asymmetric public key could be verified with a symmetric HS256 algorithm. This can lead to successful validation of forged tokens.

Am I affected?

You will be affected if your application is supporting usage of both symmetric key and asymmetric key in jwt.verify() implementation with the same key retrieval function.

How do I fix it?

Update to version 9.0.0.

Will the fix impact my users?

There is no impact for end users

CVE-2022-23540

Overview

In versions <=8.5.1 of jsonwebtoken library, lack of algorithm definition and a falsy secret or key in the jwt.verify() function can lead to signature validation bypass due to defaulting to the none algorithm for signature verification.

Am I affected?

You will be affected if all the following are true in the jwt.verify() function:

  • a token with no signature is received
  • no algorithms are specified
  • a falsy (e.g. null, false, undefined) secret or key is passed

How do I fix it?

Update to version 9.0.0 which removes the default support for the none algorithm in the jwt.verify() method.

Will the fix impact my users?

There will be no impact, if you update to version 9.0.0 and you don’t need to allow for the none algorithm. If you need 'none' algorithm, you have to explicitly specify that in jwt.verify() options.


Release Notes

auth0/node-jsonwebtoken (jsonwebtoken)

v9.0.0

Compare Source

Breaking changes: See Migration from v8 to v9

Breaking changes
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

Configuration

📅 Schedule: Branch creation - "" in timezone Europe/London, Automerge - At any time (no schedule defined).

🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot added the dependencies label Oct 4, 2023
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from b7e6726 to a10411e Compare October 18, 2023 16:22
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from a10411e to cc0bcd3 Compare November 23, 2023 11:39
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from cc0bcd3 to 47b7771 Compare November 24, 2023 09:48
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from 47b7771 to 09c8037 Compare November 24, 2023 11:42
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch 2 times, most recently from 1f637c5 to 09eaffe Compare November 30, 2023 01:06
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from 09eaffe to 7ff1c19 Compare February 8, 2024 15:17
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from 7ff1c19 to 993e02e Compare March 8, 2024 09:26
Copy link
Contributor Author

renovate bot commented Mar 8, 2024

⚠ Artifact update problem

Renovate failed to update an artifact related to this branch. You probably do not want to merge this PR as-is.

♻ Renovate will retry this branch, including artifacts, only when one of the following happens:

  • any of the package files in this branch needs updating, or
  • the branch becomes conflicted, or
  • you click the rebase/retry checkbox if found above, or
  • you rename this PR's title to start with "rebase!" to trigger it manually

The artifact failure details are included below:

File name: yarn.lock
[16:18:00.748] INFO (72): Installing tool [email protected]...
[16:18:01.234] ERROR (72): download failed
    run: 3
    err: {
      "type": "HTTPError",
      "message": "Response code 404 (Not Found)",
      "stack":
          HTTPError: Response code 404 (Not Found)
              at _Request._onResponseBase (/snapshot/dist/containerbase-cli.js:44592:25)
              at _Request._onResponse (/snapshot/dist/containerbase-cli.js:44647:18)
              at ClientRequest.<anonymous> (/snapshot/dist/containerbase-cli.js:44662:17)
              at Object.onceWrapper (node:events:633:26)
              at ClientRequest.emit (node:events:530:35)
              at ClientRequest.emit (node:domain:488:12)
              at HTTPParser.parserOnIncomingClient (node:_http_client:693:27)
              at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17)
              at TLSSocket.socketOnData (node:_http_client:535:22)
              at TLSSocket.emit (node:events:518:28)
      "code": "ERR_NON_2XX_3XX_RESPONSE",
      "timings": {
        "start": 1714580281198,
        "socket": 1714580281198,
        "lookup": 1714580281198,
        "connect": 1714580281198,
        "secureConnect": 1714580281198,
        "upload": 1714580281199,
        "response": 1714580281231,
        "end": 1714580281232,
        "phases": {
          "wait": 0,
          "dns": 0,
          "tcp": 0,
          "tls": 0,
          "request": 1,
          "firstByte": 32,
          "download": 1,
          "total": 34
        }
      },
      "name": "HTTPError",
      "options": {
        "agent": {},
        "decompress": true,
        "timeout": {},
        "prefixUrl": "",
        "ignoreInvalidCookies": false,
        "context": {},
        "hooks": {
          "init": [],
          "beforeRequest": [],
          "beforeError": [],
          "beforeRedirect": [],
          "beforeRetry": [],
          "afterResponse": []
        },
        "followRedirect": true,
        "maxRedirects": 10,
        "throwHttpErrors": true,
        "username": "",
        "password": "",
        "http2": false,
        "allowGetBody": false,
        "headers": {
          "user-agent": "containerbase/10.5.2 node/20.11.1 (https://github.com/containerbase)",
          "accept-encoding": "gzip, deflate, br"
        },
        "methodRewriting": false,
        "retry": {
          "limit": 2,
          "methods": [
            "GET",
            "PUT",
            "HEAD",
            "DELETE",
            "OPTIONS",
            "TRACE"
          ],
          "statusCodes": [
            408,
            413,
            429,
            500,
            502,
            503,
            504,
            521,
            522,
            524
          ],
          "errorCodes": [
            "ETIMEDOUT",
            "ECONNRESET",
            "EADDRINUSE",
            "ECONNREFUSED",
            "EPIPE",
            "ENOTFOUND",
            "ENETUNREACH",
            "EAI_AGAIN"
          ],
          "backoffLimit": null,
          "noise": 100
        },
        "method": "GET",
        "cacheOptions": {},
        "https": {},
        "resolveBodyOnly": false,
        "isStream": true,
        "responseType": "text",
        "url": "https://nodejs.org/dist/v18.16.9/SHASUMS256.txt",
        "pagination": {
          "countLimit": null,
          "backoff": 0,
          "requestLimit": 10000,
          "stackAllItems": false
        },
        "setHost": true,
        "enableUnixSockets": false
      }
    }
[16:18:01.237] FATAL (72): download failed
    err: {
      "type": "Error",
      "message": "download failed",
      "stack":
          Error: download failed
              at HttpService.download (/snapshot/dist/containerbase-cli.js:48015:11)
              at async InstallNodeService.install (/snapshot/dist/containerbase-cli.js:53790:30)
              at async InstallToolService.execute (/snapshot/dist/containerbase-cli.js:54374:11)
              at async InstallToolShortCommand.execute (/snapshot/dist/containerbase-cli.js:54592:14)
              at async InstallToolShortCommand.validateAndExecute (/snapshot/dist/containerbase-cli.js:2430:26)
              at async _Cli.run (/snapshot/dist/containerbase-cli.js:3543:22)
              at async _Cli.runExit (/snapshot/dist/containerbase-cli.js:3551:28)
              at async main (/snapshot/dist/containerbase-cli.js:54786:3)
    }
[16:18:01.333] INFO (72): Installed tool node with errors in 584ms.

@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from 993e02e to d499c06 Compare March 8, 2024 14:13
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from d499c06 to 544740b Compare March 18, 2024 10:34
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch 3 times, most recently from fc93035 to eaf4e88 Compare April 12, 2024 12:58
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch 2 times, most recently from afd26cc to 628acad Compare April 19, 2024 13:06
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from 628acad to e9e790a Compare May 1, 2024 16:18
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from e9e790a to a53cd46 Compare May 22, 2024 15:12
@renovate renovate bot force-pushed the renovate/npm-jsonwebtoken-vulnerability branch from a53cd46 to 9686908 Compare July 18, 2024 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

0 participants