5.9medium
Padding Oracle Attack due to Observable Timing Discrepancy in jose-node-cjs-runtime
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.07% (higher than 65% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-rvcw-f68w-8h8h
Description
jose-node-cjs-runtime is an npm package which provides a number of cryptographic functions. In versions prior to 3.11.4 the AES_CBC_HMAC_SHA2 Algorithm (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). 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`.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| panva jose-node-cjs-runtime | < 3.11.4 | CVE List |
| jose-node-cjs-runtime (npm) | before 3.11.4 | GitHub Advisory Database |
| jose-node-cjs-runtime_project jose-node-cjs-runtime | before 3.11.4 | NVD |
All scores
| GitHub_M | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| GitHub | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 5.9medium CVSS:3.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N |
| NVD | 4.3medium CVSS:2.0 | AV:N/AC:M/Au:N/C:P/I:N/A:N |
Classification
What each source says
CVE List
jose-node-cjs-runtime is an npm package which provides a number of cryptographic functions. In versions prior to 3.11.4 the AES_CBC_HMAC_SHA2 Algorithm (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). 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`.
GitHub Advisory Database
Impact
AES_CBC_HMAC_SHA2 Algorithm (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.
NVD (es)
jose-node-cjs-runtime es un paquete npm que proporciona una serie de funciones criptográficas. En versiones anteriores a 3.11.4, el descifrado del algoritmo AES_CBC_HMAC_SHA2 (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) siempre ejecutaba tanto la comprobación de etiquetas HMAC como el descifrado CBC, si se presentaba un fallo "JWEDecryptionFailed" sería lanzado. Pero una posible diferencia observable en el tiempo cuando se produciría un error de padding al descifrar el texto cifrado crea un padding oracle y un adversario podría hacer uso de ese oracle para descifrar datos sin conocer la clave de descifrado emitiendo un promedio de 128*b llamadas al padding oracle (donde b es el número de bytes en el bloque de texto cifrado). Se lanzó un parche que garantiza que la etiqueta HMAC es comprobada antes de llevar a cabo el descifrado CBC. Las versiones corregidas son "superiores o iguales a 3.11.4". Los usuarios deben actualizar a "^3.11.4"
References
| https://github.com/panva/jose/security/advisories/GHSA-rvcw-f68w-8h8h | third-party-advisory, web | |
| https://www.npmjs.com/package/jose-node-cjs-runtime | product, third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29446 | advisory | |
| https://github.com/panva/jose | package | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29446 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-rvcw-f68w-8h8h changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29446 changed 2026-06-17 | Public domain |