Staging Environment: Content and features may be unstable or change without notice.
Search for packages
Package details: pkg:npm/jose@3.4.0
purl pkg:npm/jose@3.4.0
Next non-vulnerable version 4.15.5
Latest non-vulnerable version 5.0.0
Risk 3.1
Vulnerabilities affecting this package (6)
Vulnerability Summary Fixed by
VCID-1rpd-33se-hkex
Aliases:
CVE-2024-28176
GHSA-hhhv-q57g-882q
jose vulnerable to resource exhaustion via specifically crafted JWE with compressed plaintext A vulnerability has been identified in the JSON Web Encryption (JWE) decryption interfaces, specifically related to the [support for decompressing plaintext after its decryption](https://www.rfc-editor.org/rfc/rfc7516.html#section-4.1.3). 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](https://www.rfc-editor.org/rfc/rfc8725.html#name-avoid-compression-of-encryp) 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 ```js 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](https://github.com/panva/jose/discussions/new?category=q-a&title=GHSA-hhhv-q57g-882q%20advisory%20question)
4.15.5
Affected by 0 other vulnerabilities.
5.0.0
Affected by 0 other vulnerabilities.
VCID-79vy-8dqy-qqgm
Aliases:
CVE-2021-29446
GHSA-rvcw-f68w-8h8h
Padding Oracle Attack due to Observable Timing Discrepancy in jose-node-cjs-runtime ### Impact [AES_CBC_HMAC_SHA2 Algorithm](https://tools.ietf.org/html/rfc7518#section-5.2) (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) decryption would always execute both HMAC tag verification and CBC decryption, if either failed `JWEDecryptionFailed` would be thrown. But a possibly observable difference in timing when padding error would occur while decrypting the ciphertext makes a padding oracle and an adversary might be able to make use of that oracle to decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). ### Patches A patch was released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `>=3.11.4`. Users should upgrade to `^3.11.4`. ### Credits Thanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
3.11.4
Affected by 2 other vulnerabilities.
VCID-7vc7-dfdz-myg8
Aliases:
CVE-2022-36083
GHSA-jv3g-j58f-9mq9
JOSE vulnerable to resource exhaustion via specifically crafted JWE The PBKDF2-based JWE key management algorithms expect a JOSE Header Parameter named `p2c` ([PBES2 Count](https://www.rfc-editor.org/rfc/rfc7518.html#section-4.8.1.2)), 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. ```js 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: * Open an discussion in the project's [repository](https://github.com/panva/jose/discussions/new?category=q-a&title=GHSA-jv3g-j58f-9mq9%20advisory%20question) * Email me at [panva.ip@gmail.com](mailto:panva.ip@gmail.com)
3.20.4
Affected by 1 other vulnerability.
4.9.2
Affected by 1 other vulnerability.
VCID-ewa6-84fq-gfgm
Aliases:
CVE-2021-29445
GHSA-4v4g-726h-xvfv
Padding Oracle Attack due to Observable Timing Discrepancy in jose-node-esm-runtime ### Impact [AES_CBC_HMAC_SHA2 Algorithm](https://tools.ietf.org/html/rfc7518#section-5.2) (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) decryption would always execute both HMAC tag verification and CBC decryption, if either failed `JWEDecryptionFailed` would be thrown. But a possibly observable difference in timing when padding error would occur while decrypting the ciphertext makes a padding oracle and an adversary might be able to make use of that oracle to decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). ### Patches A patch was released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `>=3.11.4`. Users should upgrade to `^3.11.4`. ### Credits Thanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
3.11.4
Affected by 2 other vulnerabilities.
VCID-mv6y-qymd-ryat
Aliases:
CVE-2021-29444
GHSA-94hh-pjjg-rwmr
Padding Oracle Attack due to Observable Timing Discrepancy in jose-browser-runtime ### Impact [AES_CBC_HMAC_SHA2 Algorithm](https://tools.ietf.org/html/rfc7518#section-5.2) (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) decryption would always execute both HMAC tag verification and CBC decryption, if either failed `JWEDecryptionFailed` would be thrown. But a possibly observable difference in timing when padding error would occur while decrypting the ciphertext makes a padding oracle and an adversary might be able to make use of that oracle to decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). ### Patches A patch was released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `>=3.11.4`. Users should upgrade to `^3.11.4`. ### Credits Thanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
3.11.4
Affected by 2 other vulnerabilities.
VCID-yzkv-xd7t-f3bv
Aliases:
CVE-2021-29443
GHSA-58f5-hfqc-jgch
Padding Oracle Attack due to Observable Timing Discrepancy in jose jose is an npm library providing a number of cryptographic operations. ### Impact [AES_CBC_HMAC_SHA2 Algorithm](https://tools.ietf.org/html/rfc7518#section-5.2) (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) decryption would always execute both HMAC tag verification and CBC decryption, if either failed `JWEDecryptionFailed` would be thrown. But a possibly observable difference in timing when padding error would occur while decrypting the ciphertext makes a padding oracle and an adversary might be able to make use of that oracle to decrypt data without knowing the decryption key by issuing on average 128*b calls to the padding oracle (where b is the number of bytes in the ciphertext block). ### Patches All major release versions have had a patch released which ensures the HMAC tag is verified before performing CBC decryption. The fixed versions are `^1.28.1 || ^2.0.5 || >=3.11.4`. Users should upgrade their v1.x dependency to [`^1.28.1`](https://github.com/panva/jose/releases/tag/v1.28.1), their v2.x dependency to [`^2.0.5`](https://github.com/panva/jose/releases/tag/v2.0.5), and their v3.x dependency to [`^3.11.4`](https://github.com/panva/jose/releases/tag/v3.11.4) ### Credits Thanks to Morgan Brown of Microsoft for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
3.11.4
Affected by 2 other vulnerabilities.
Vulnerabilities fixed by this package (0)
Vulnerability Summary Aliases
This package is not known to fix vulnerabilities.

Date Actor Action Vulnerability Source VulnerableCode Version
2026-04-16T22:53:39.634670+00:00 GitLab Importer Affected by VCID-1rpd-33se-hkex https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2024-28176.yml 38.4.0
2026-04-16T22:08:26.108298+00:00 GitLab Importer Affected by VCID-7vc7-dfdz-myg8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2022-36083.yml 38.4.0
2026-04-16T21:21:04.016838+00:00 GitLab Importer Affected by VCID-yzkv-xd7t-f3bv https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29443.yml 38.4.0
2026-04-16T21:21:03.348102+00:00 GitLab Importer Affected by VCID-79vy-8dqy-qqgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29446.yml 38.4.0
2026-04-16T21:21:01.961672+00:00 GitLab Importer Affected by VCID-mv6y-qymd-ryat https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29444.yml 38.4.0
2026-04-16T21:21:00.905933+00:00 GitLab Importer Affected by VCID-ewa6-84fq-gfgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29445.yml 38.4.0
2026-04-12T00:12:03.183245+00:00 GitLab Importer Affected by VCID-1rpd-33se-hkex https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2024-28176.yml 38.3.0
2026-04-11T23:24:52.056764+00:00 GitLab Importer Affected by VCID-7vc7-dfdz-myg8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2022-36083.yml 38.3.0
2026-04-11T22:33:30.481780+00:00 GitLab Importer Affected by VCID-yzkv-xd7t-f3bv https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29443.yml 38.3.0
2026-04-11T22:33:29.760656+00:00 GitLab Importer Affected by VCID-79vy-8dqy-qqgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29446.yml 38.3.0
2026-04-11T22:33:28.194218+00:00 GitLab Importer Affected by VCID-mv6y-qymd-ryat https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29444.yml 38.3.0
2026-04-11T22:33:26.933024+00:00 GitLab Importer Affected by VCID-ewa6-84fq-gfgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29445.yml 38.3.0
2026-04-03T00:18:24.455271+00:00 GitLab Importer Affected by VCID-1rpd-33se-hkex https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2024-28176.yml 38.1.0
2026-04-02T23:31:13.024673+00:00 GitLab Importer Affected by VCID-7vc7-dfdz-myg8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2022-36083.yml 38.1.0
2026-04-02T22:44:38.629455+00:00 GitLab Importer Affected by VCID-yzkv-xd7t-f3bv https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29443.yml 38.1.0
2026-04-02T22:44:37.932695+00:00 GitLab Importer Affected by VCID-79vy-8dqy-qqgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29446.yml 38.1.0
2026-04-02T22:44:36.585253+00:00 GitLab Importer Affected by VCID-mv6y-qymd-ryat https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29444.yml 38.1.0
2026-04-02T22:44:35.428191+00:00 GitLab Importer Affected by VCID-ewa6-84fq-gfgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29445.yml 38.1.0
2026-04-01T17:52:49.187382+00:00 GitLab Importer Affected by VCID-7vc7-dfdz-myg8 https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2022-36083.yml 38.0.0
2026-04-01T17:02:34.394734+00:00 GitLab Importer Affected by VCID-yzkv-xd7t-f3bv https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29443.yml 38.0.0
2026-04-01T17:02:33.694642+00:00 GitLab Importer Affected by VCID-79vy-8dqy-qqgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29446.yml 38.0.0
2026-04-01T17:02:32.168935+00:00 GitLab Importer Affected by VCID-mv6y-qymd-ryat https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29444.yml 38.0.0
2026-04-01T17:02:31.074453+00:00 GitLab Importer Affected by VCID-ewa6-84fq-gfgm https://gitlab.com/gitlab-org/advisories-community/-/blob/main/npm/jose/CVE-2021-29445.yml 38.0.0