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`](https://redirect.github.com/panva/jose/releases/tag/v4.15.5)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.4...v4.15.5)
##### Fixes
- add a maxOutputLength option to zlib inflate ([1b91d88](https://redirect.github.com/panva/jose/commit/1b91d88d2f8233f3477a5f4579aa5f8057b2ee8b)), fixes [CVE-2024-28176](https://redirect.github.com/panva/jose/security/advisories/GHSA-hhhv-q57g-882q)
### [`v4.15.4`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4154-2023-10-14)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.3...v4.15.4)
##### Fixes
- **types:** export GetKeyFunction ([#592](https://redirect.github.com/panva/jose/issues/592)) ([936c9df](https://redirect.github.com/panva/jose/commit/936c9dff2bc124dc5f64906a96f665a28e57392c)), closes [#591](https://redirect.github.com/panva/jose/issues/591)
### [`v4.15.3`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4153-2023-10-11)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.2...v4.15.3)
### [`v4.15.2`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4152-2023-10-04)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.1...v4.15.2)
##### Fixes
- **build:** add a node target for jose-browser-runtime releases ([abb63d0](https://redirect.github.com/panva/jose/commit/abb63d0e8e7a55326dc343eec5f5eee9addc1dcf))
### [`v4.15.1`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4151-2023-10-02)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.0...v4.15.1)
##### Fixes
- resolve missing types for the cryptoRuntime const ([1627965](https://redirect.github.com/panva/jose/commit/16279652a67133fba0db7c9879767f000a8f1662))
### [`v4.15.0`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4150-2023-10-02)
[Compare Source](https://redirect.github.com/panva/jose/compare/v4.14.6...v4.15.0)
##### Features
- export the used crypto runtime as a constant ([0681dda](https://redirect.github.com/panva/jose/commit/0681dda1592a82c22a18981002b3763c502d0fc4))
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 contains the following updates:
4.14.6
->4.15.5
GitHub Vulnerability Alerts
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
Patches
v2.0.7
andv4.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 theinflateRaw
decryption option implementation. In v2.x it is possible to further adjust this limit via theinflateRawSyncLimit
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
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`](https://redirect.github.com/panva/jose/releases/tag/v4.15.5) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.4...v4.15.5) ##### Fixes - add a maxOutputLength option to zlib inflate ([1b91d88](https://redirect.github.com/panva/jose/commit/1b91d88d2f8233f3477a5f4579aa5f8057b2ee8b)), fixes [CVE-2024-28176](https://redirect.github.com/panva/jose/security/advisories/GHSA-hhhv-q57g-882q) ### [`v4.15.4`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4154-2023-10-14) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.3...v4.15.4) ##### Fixes - **types:** export GetKeyFunction ([#592](https://redirect.github.com/panva/jose/issues/592)) ([936c9df](https://redirect.github.com/panva/jose/commit/936c9dff2bc124dc5f64906a96f665a28e57392c)), closes [#591](https://redirect.github.com/panva/jose/issues/591) ### [`v4.15.3`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4153-2023-10-11) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.2...v4.15.3) ### [`v4.15.2`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4152-2023-10-04) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.1...v4.15.2) ##### Fixes - **build:** add a node target for jose-browser-runtime releases ([abb63d0](https://redirect.github.com/panva/jose/commit/abb63d0e8e7a55326dc343eec5f5eee9addc1dcf)) ### [`v4.15.1`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4151-2023-10-02) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.15.0...v4.15.1) ##### Fixes - resolve missing types for the cryptoRuntime const ([1627965](https://redirect.github.com/panva/jose/commit/16279652a67133fba0db7c9879767f000a8f1662)) ### [`v4.15.0`](https://redirect.github.com/panva/jose/blob/HEAD/CHANGELOG.md#4150-2023-10-02) [Compare Source](https://redirect.github.com/panva/jose/compare/v4.14.6...v4.15.0) ##### Features - export the used crypto runtime as a constant ([0681dda](https://redirect.github.com/panva/jose/commit/0681dda1592a82c22a18981002b3763c502d0fc4))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.
This PR was generated by Mend Renovate. View the repository job log.