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

fix(deps): update dependency jose to v2.0.6 [security] #3448

Closed
wants to merge 1 commit into from

Conversation

renovate[bot]
Copy link
Contributor

@renovate renovate bot commented Jun 13, 2023

Mend Renovate

This PR contains the following updates:

Package Change Age Adoption Passing Confidence
jose 2.0.5 -> 2.0.6 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:


Release Notes

panva/jose (jose)

v2.0.6

Compare Source

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

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 has been generated by Mend Renovate. View repository job log here.

@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch 2 times, most recently from 0ec51e4 to d19eddc Compare June 27, 2023 13:50
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from d19eddc to 2e20e14 Compare July 13, 2023 05:52
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from 2e20e14 to 10ba78e Compare August 8, 2023 11:28
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from 10ba78e to d2665c0 Compare August 16, 2023 10:56
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from d2665c0 to b56dc34 Compare August 31, 2023 13:17
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from b56dc34 to 7e72ef0 Compare September 13, 2023 18:20
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from 7e72ef0 to cde7532 Compare October 10, 2023 17:54
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch 2 times, most recently from 7ce56c1 to 92e15b0 Compare November 1, 2023 07:24
@renovate renovate bot force-pushed the renovate/npm-jose-vulnerability branch from 92e15b0 to 75b35f2 Compare November 9, 2023 08:12
Copy link

sonarcloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!Β  Β  Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@SavelevMatthew SavelevMatthew added the ☠ Dead / 🐞 Debug Needs to be closed. You don't need to look at this PR label Nov 10, 2023
@SavelevMatthew SavelevMatthew deleted the renovate/npm-jose-vulnerability branch November 10, 2023 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☠ Dead / 🐞 Debug Needs to be closed. You don't need to look at this PR dependencies
Development

Successfully merging this pull request may close these issues.

None yet

1 participant