CVE-2021-29445
JSON

5.9medium

Padding Oracle Attack due to Observable Timing Discrepancy in jose-node-esm-runtime

Severity
5.9medium CVSS:3.1 by GitHub_M
Exploit likelihood
1.07% (higher than 64% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-4v4g-726h-xvfv

Description

jose-node-esm-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 packageVersionsReported by
panva jose-node-esm-runtime< 3.11.4CVE List
jose-node-esm-runtime (npm)before 3.11.4GitHub Advisory Database
jose-node-cjs-runtime_project jose-node-cjs-runtimebefore 3.11.4NVD

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-node-esm-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-esm-runtime es un paquete npm que proporciona una serie de funciones criptográficas.&#xa0;En versiones anteriores a 3.11.4, el algoritmo de descifrado AES_CBC_HMAC_SHA2 (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) siempre ejecutaba tanto la comprobación de etiquetas HMAC como el descifrado CBC, si cometía un fallo "JWEDecryptionFailed" sería lanzado.&#xa0;Pero una posible diferencia observable en el tiempo cuando se produciría un error de relleno 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 emitiendo un promedio de 128*b llamadas al padding oracle (donde b es el número de bytes en el bloque de texto cifrado).&#xa0;Se lanzó un parche que garantiza que la etiqueta HMAC se verifique antes de llevar a cabo el descifrado CBC.&#xa0;Las versiones corregidas son "superiores o iguales a 3.11.4".&#xa0;Los usuarios deben actualizar a "^ 3.11.4"

References

Sources

SourceRecordLicence
CVE ListCVE-2021-29445 changed 2024-08-03CVE Terms of Use
GitHub Advisory DatabaseGHSA-4v4g-726h-xvfv changed 2026-07-08CC-BY-4.0
NVDCVE-2021-29445 changed 2026-06-17Public domain