VYPR
Moderate severityNVD Advisory· Published Apr 16, 2021· Updated Aug 3, 2024

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

CVE-2021-29445

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.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Prior to version 3.11.4, jose-node-esm-runtime's AES_CBC_HMAC_SHA2 decryption had a timing discrepancy allowing a padding oracle attack to decrypt data without the key.

Vulnerability

In jose-node-esm-runtime versions prior to 3.11.4, the AES_CBC_HMAC_SHA2 algorithm decryption (A128CBC-HS256, A192CBC-HS384, A256CBC-HS512) executed both HMAC tag verification and CBC decryption regardless of errors. If either failed, JWEDecryptionFailed was thrown. However, a timing discrepancy occurs when a padding error arises during CBC decryption, enabling a padding oracle attack. This affects all versions before 3.11.4. [1][3]

Exploitation

An attacker with network access to observe timing can send crafted ciphertexts to the decryption oracle. By measuring response times, the attacker can determine padding validity. On average, 128*b calls are needed (b = ciphertext block bytes) to decrypt the entire ciphertext without knowing the key. [1][3]

Impact

Successful exploitation allows an attacker to decrypt arbitrary ciphertexts encrypted with the affected algorithm, leading to information disclosure of sensitive data. No authentication is required for the oracle. [1][3]

Mitigation

The fix ensures HMAC tag verification occurs before CBC decryption, eliminating the timing discrepancy. Fixed in version 3.11.4 and later. Users should upgrade to ^3.11.4. No workaround available. [1][3]

AI Insight generated on May 21, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
jose-node-esm-runtimenpm
< 3.11.43.11.4

Affected products

2

Patches

0

No patches discovered yet.

Vulnerability mechanics

AI mechanics synthesis has not run for this CVE yet.

References

4

News mentions

0

No linked articles in our index yet.