5.9medium
Padding Oracle Attack due to Observable Timing Discrepancy in jose
- Severity
- 5.9medium CVSS:3.1 by GitHub_M
- Exploit likelihood
- 1.17% (higher than 68% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-58f5-hfqc-jgch
Description
jose is an npm library providing a number of cryptographic operations. In vulnerable versions 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. 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). 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, their v2.x dependency to ^2.0.5, and their v3.x dependency to ^3.11.4. Thanks to Jason from Microsoft Vulnerability Research (MSVR) for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| panva jose | < 1.28.1, >= 2.0.0, < 2.0.5, >= 3.0.0, < 3.11.4, from 1.0.0 before 1.28.1, from 2.0.0 before 2.0.5, from 3.0.0 before 3.11.4 | CVE List, NVD |
| jose (npm) | from 1.0.0 before 1.28.1, from 2.0.0 before 2.0.5, from 3.0.0 before 3.11.4 | GitHub Advisory Database |
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 is an npm library providing a number of cryptographic operations. In vulnerable versions 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. 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). 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, their v2.x dependency to ^2.0.5, and their v3.x dependency to ^3.11.4. Thanks to Jason from Microsoft Vulnerability Research (MSVR) for bringing this up and Eva Sarafianou (@esarafianou) for helping to score this advisory.
GitHub Advisory Database
jose is an npm library providing a number of cryptographic operations.
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
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, their v2.x dependency to ^2.0.5, and their v3.x dependency 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 es una biblioteca npm que proporciona una serie de operaciones criptográficas. En versiones vulnerables el algoritmo AES_CBC_HMAC_SHA2 (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512), el descifrado siempre ejecutaba tanto la verificación de etiquetas HMAC como el descifrado CBC, si cualquiera de los dos presentaba un fallo, "JWEDecryptionFailed" sería lanzado. Una posible diferencia observable en el tiempo cuando un error de padding podría ocurrir al descifrar el texto cifrado crea un padding oracle y un adversario podría ser capaz de hacer uso de ese oracle para descifrar datos sin conocer la clave de descifrado al emitir un promedio de 128*b llamadas padding oracle (donde b es el número de bytes en el bloque de texto cifrado). Todas las versiones de lanzamiento principales han recibido un parche que garantiza que la etiqueta HMAC se verifique antes de llevar a cabo el descifrado CBC. Las versiones fijas son ^1.28.1 || ^2.0.5 || superiores o iguales a 3.11.4. Los usuarios deben actualizar su dependencia versiones v1.x hasta ^1.28.1, su dependencia versiones v2.x hasta ^ 2.0.5 y su dependencia versiones v3.x hasta ^3.11.4. Gracias a Jason de Microsoft Vulnerability Research (MSVR) por mencionar este tema y a Eva Sarafianou (@esarafianou) por ayudar a calificar este aviso
References
| https://github.com/panva/jose/security/advisories/GHSA-58f5-hfqc-jgch | patch, third-party-advisory, web | |
| https://www.npmjs.com/package/jose | third-party-advisory, web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-29443 | advisory | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-29443 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-58f5-hfqc-jgch changed 2026-07-08 | CC-BY-4.0 |
| NVD | CVE-2021-29443 changed 2026-06-22 | Public domain |