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 jose to v4.15.5 [SECURITY] #74

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

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Apr 17, 2023

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
jose 4.5.1 -> 4.15.5 age adoption passing confidence

GitHub Vulnerability Alerts

CVE-2022-36083

The PBKDF2-based JWE key management algorithms expect a JOSE Header Parameter named p2c (PBES2 Count), which determines how many PBKDF2 iterations must be executed in order to derive a CEK wrapping key. The purpose of this parameter is to intentionally slow down the key derivation function in order to make password brute-force and dictionary attacks more expensive.

This makes the PBES2 algorithms unsuitable for situations where the JWE is coming from an untrusted source: an adversary can intentionally pick an extremely high PBES2 Count value, that will initiate a CPU-bound computation that may take an unreasonable amount of time to finish.

Impact

Under certain conditions (see below) it is possible to have the user's environment consume unreasonable amount of CPU time.

Affected users

The impact is limited only to users utilizing the JWE decryption APIs with symmetric secrets to decrypt JWEs from untrusted parties who do not limit the accepted JWE Key Management Algorithms (alg Header Parameter) using the keyManagementAlgorithms (or algorithms in v1.x) decryption option or through other means.

The PBKDF2-based JWE Key Management Algorithm Identifiers are

  • PBES2-HS256+A128KW
  • PBES2-HS384+A192KW
  • PBES2-HS512+A256KW

e.g.

const secret = new Uint8Array(16)
const jwe = '...' // JWE from an untrusted party

await jose.compactDecrypt(jwe, secret)

You are NOT affected if any of the following applies to you

  • Your code does not use the JWE APIs
  • Your code only produces JWE tokens
  • Your code only decrypts JWEs using an asymmetric JWE Key Management Algorithm (this means you're providing an asymmetric key object to the JWE decryption API)
  • Your code only accepts JWEs produced by trusted sources
  • Your code limits the accepted JWE Key Management Algorithms using the keyManagementAlgorithms decryption option not including any of the PBKDF2-based JWE key management algorithms

Patches

v1.28.2, v2.0.6, v3.20.4, and v4.9.2 releases limit the maximum PBKDF2 iteration count to 10000 by default. It is possible to adjust this limit with a newly introduced maxPBES2Count decryption option.

Workarounds

All users should be able to upgrade given all stable semver major release lines have had new a patch release introduced which limits the PBKDF2 iteration count to 10000 by default. This removes the ability to craft JWEs that would consume unreasonable amount of CPU time.

If users are unable to upgrade their required library version they have two options depending on whether they expect to receive JWEs using any of the three PBKDF2-based JWE key management algorithms.

  • they can use the keyManagementAlgorithms decryption option to disable accepting PBKDF2 altogether
  • they can inspect the JOSE Header prior to using the decryption API and limit the PBKDF2 iteration count (p2c Header Parameter)

For more information

If you have any questions or comments about this advisory:

CVE-2024-28176

A vulnerability has been identified in the JSON Web Encryption (JWE) decryption interfaces, specifically related to the support for decompressing plaintext after its decryption. This allows an adversary to exploit specific scenarios where the compression ratio becomes exceptionally high. As a result, the length of the JWE token, which is determined by the compressed content's size, can land below application-defined limits. In such cases, other existing application level mechanisms for preventing resource exhaustion may be rendered ineffective.

Note that as per RFC 8725 compression of data SHOULD NOT be done before encryption, because such compressed data often reveals information about the plaintext. For this reason the v5.x major version of jose removed support for compressed payloads entirely and is therefore NOT affected by this advisory.

Impact

Under certain conditions it is possible to have the user's environment consume unreasonable amount of CPU time or memory during JWE Decryption operations.

Affected users

The impact is limited only to Node.js users utilizing the JWE decryption APIs to decrypt JWEs from untrusted sources.

You are NOT affected if any of the following applies to you

  • Your code uses jose version v5.x where JWE Compression is not supported anymore
  • Your code runs in an environment other than Node.js (e.g. Deno, CF Workers), which is the only runtime where JWE Compression is implemented out of the box
  • Your code does not use the JWE decryption APIs
  • Your code only accepts JWEs produced by trusted sources

Patches

v2.0.7 and v4.15.5 releases limit the decompression routine to only allow decompressing up to 250 kB of plaintext. In v4.x it is possible to further adjust this limit via the inflateRaw decryption option implementation. In v2.x it is possible to further adjust this limit via the inflateRawSyncLimit decryption option.

Workarounds

If you cannot upgrade and do not want to support compressed JWEs you may detect and reject these tokens early by checking the token's protected header

const { zip } = jose.decodeProtectedHeader(token)
if (zip !== undefined) {
  throw new Error('JWE Compression is not supported')
}

If you wish to continue supporting JWEs with compressed payloads in these legacy release lines you must upgrade (v1.x and v2.x to version v2.0.7, v3.x and v4.x to version v4.15.5) and review the limits put forth by the patched releases.

For more information

If you have any questions or comments about this advisory please open a discussion in the project's repository


Release Notes

panva/jose (jose)

v4.15.5

Compare Source

Fixes

v4.15.4

Compare Source

Fixes

v4.15.3

Compare Source

v4.15.2

Compare Source

Fixes
  • build: add a node target for jose-browser-runtime releases (abb63d0)

v4.15.1

Compare Source

Fixes
  • resolve missing types for the cryptoRuntime const (1627965)

v4.15.0

Compare Source

Features
  • export the used crypto runtime as a constant (0681dda)

v4.14.6

Compare Source

Fixes
  • build: publish bundle and umd files with jose-browser-runtime module (62fcbcc), closes #​571

v4.14.5

Compare Source

Refactor
  • catch type error when decoding base64url signature (#​569) (935e920)
  • catch type errors when decoding various base64url strings (9024e87)

v4.14.4

Compare Source

Refactor
  • cleanup NODE-ED25519 workerd workarounds (072e83d)

v4.14.3

Compare Source

Reverts
  • Revert "fix(types): headers and payloads may only be JSON values and primitives" (06d8101), closes #​534

v4.14.2

Compare Source

Fixes
  • types: headers and payloads may only be JSON values and primitives (24f306e)

v4.14.1

Compare Source

v4.14.0

Compare Source

Features
  • add requiredClaims JWT validation option (eeea91d)

v4.13.2

Compare Source

Refactor
  • src/util/decode_protected_header.ts (5716725)

v4.13.1

Compare Source

Fixes
  • workerd: avoid "The script will never generate a response" edge cases completely (96a8c99), closes #​355 #​509

v4.13.0

Compare Source

Features
  • types: allow generics to aid in CryptoKey or KeyObject narrowing of KeyLike (6effa4d)
Fixes
  • make jose.EmbeddedJWK arguments optional (20610a9)

v4.12.2

Compare Source

Fixes
  • types: declare explicit return from EmbeddedJWK (46934ac)

v4.12.1

Compare Source

Refactor
  • clarify when alg is used and required on key imports (19e525f)
  • node: have node:crypto deal with x509 parsing (45bb45d)

v4.12.0

Compare Source

Features
  • enable key iteration over JWKSMultipleMatchingKeys (a278acd)

v4.11.4

Compare Source

Fixes
  • build: ignore deno files in npm publishes (b3d6a11)

v4.11.3

Compare Source

Fixes
  • CF Workers: improve miniflare compat with different Node.js versions, get ready for future non-proprietary support (3406b9f), closes #​446 #​495 #​497

v4.11.2

Compare Source

Refactor
  • node: dry node version checks (aff2f7c)

v4.11.1

Compare Source

v4.11.0

Compare Source

Features
  • add bun as a supported runtime (3a63631)
Fixes
  • respect JWK ext for symmetric keys (20557fc)

v4.10.4

Compare Source

Fixes
  • typo in importPKSC8 error message (#​468) (746bc64)
  • workaround for invalid use checks on CF Workers and Deno (e4d04eb)

v4.10.3

Compare Source

v4.10.2

Compare Source

v4.10.1

Compare Source

v4.10.0

Compare Source

Features
  • Curve25519, and Curve448 support for WebCryptoAPI runtimes (fea359a)
Fixes
  • importX509: handle length encodings better (47d0d77), closes #​459

v4.9.3

Compare Source

Refactor
  • update CEK length validation error message (81a92a9)
  • update key input validation error messages (2eac34a)
  • update keylike description for WinterCG (6741679)

v4.9.2

Compare Source

Fixes
  • limit default PBES2 alg's computational expense (03d6d01)

v4.9.1

Compare Source

Fixes
  • deno: add a Deno package entrypoint (9f3c459)

v4.9.0

Compare Source

Features
  • add support for RFC 9278 - JWK Thumbprint URI (d06ce65)
Refactor
  • consume some base64url decode errors (#​436) (caaf2c3)
  • unify JOSENotSupported throw on key export (fe5d093)

v4.8.3

Compare Source

v4.8.1

Compare Source

Fixes
  • typescript: add types export for nodenext module resolution (#​406) (5a6d8f0)

v4.8.0

Compare Source

Features

v4.7.0

Compare Source

Features

v4.6.2

Compare Source

Fixes
  • dont check JWT iat is in the past unless maxTokenAge is used (96d85c7)

v4.6.1

Compare Source

v4.6.0

Compare Source

Features
  • mark APIs and parameters that can lead to footguns as deprecated (0ddbcc6)
  • types: include JSDoc in the types (74187a9)

v4.5.3

Compare Source

Fixes
  • web api runtime: rely on default fetch init values (df6d966)

v4.5.2

Compare Source

Fixes

Configuration

📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).

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

Rebasing: Whenever PR becomes conflicted, 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 force-pushed the renovate/npm-jose-vulnerability branch from e5a1bc0 to a60f39b Compare March 7, 2024 21:18
@renovate renovate bot changed the title Update dependency jose to v4.9.2 [SECURITY] Update dependency jose to v4.15.5 [SECURITY] Mar 7, 2024
Copy link
Contributor Author

renovate bot commented Mar 7, 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: pnpm-lock.yaml
 WARN  The "store" setting has been renamed to "store-dir". Please use the new name.
 WARN  GET https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.2.2.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint/-/eslint-8.10.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.4.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.5.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/sass/-/sass-1.49.9.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/unplugin-vue-components/-/unplugin-vue-components-0.17.21.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vite/-/vite-2.8.4.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-inspect/-/vite-plugin-inspect-0.4.3.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-pages/-/vite-plugin-pages-0.20.2.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-server/-/vite-plugin-server-0.1.2.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/jose error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@vuetify%2Fnightly error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.12.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.12.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-2.2.2.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/eslint/-/eslint-8.10.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.4.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-8.5.0.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/sass/-/sass-1.49.9.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/typescript/-/typescript-4.5.5.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/unplugin-vue-components/-/unplugin-vue-components-0.17.21.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/vite/-/vite-2.8.4.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-inspect/-/vite-plugin-inspect-0.4.3.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-pages/-/vite-plugin-pages-0.20.2.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/vite-plugin-server/-/vite-plugin-server-0.1.2.tgz error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/jose error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/@vuetify%2Fnightly error (ERR_INVALID_THIS). Will retry in 1 minute. 1 retries left.
 WARN  GET https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-8.3.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
undefined
 ERR_INVALID_THIS  Value of "this" must be of type URLSearchParams
 WARN  GET https://registry.npmjs.org/@mdi/js/-/js-6.5.95.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/@vueuse/core/-/core-7.7.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vue/-/vue-3.2.31.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vue-router/-/vue-router-4.0.12.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.
 WARN  GET https://registry.npmjs.org/vue-tsc/-/vue-tsc-0.32.0.tgz error (ERR_INVALID_THIS). Will retry in 10 seconds. 2 retries left.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants