CVE-2021-29443
JSON

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 packageVersionsReported 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.4CVE 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.4GitHub Advisory Database

All scores

GitHub_M5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
GitHub5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD5.9medium CVSS:3.1CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
NVD4.3medium CVSS:2.0AV: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.&#xa0;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.&#xa0;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).&#xa0;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.&#xa0;Las versiones fijas son ^1.28.1 || ^2.0.5 || superiores o iguales a 3.11.4.&#xa0;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.&#xa0;Gracias a Jason de Microsoft Vulnerability Research (MSVR) por mencionar este tema y a Eva Sarafianou (@esarafianou) por ayudar a calificar este aviso

References

Sources

SourceRecordLicence
CVE ListCVE-2021-29443 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-58f5-hfqc-jgch changed 2026-07-08CC-BY-4.0
NVDCVE-2021-29443 changed 2026-06-22Public domain