CVE-2021-29446: Padding Oracle Attack in jose-node-cjs-runtime
Summary
CVE-2021-29446: Padding Oracle Attack due to Observable Timing Discrepancy in jose-node-cjs-runtime. Affects jose-node-cjs-runtime versions < 3.11.4. Fixed in 3.11.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
jose-node-cjs-runtime is an npm package that provides a JavaScript implementation of the JSON Object Signing and Encryption (JOSE) standards. It offers functionality for creating, signing, and encrypting JSON Web Tokens (JWTs) using various algorithms. The package is widely used in applications that require secure token-based authentication and data exchange. However, a vulnerability has been discovered in the package that could lead to a padding oracle attack.
Vulnerability Detail
The vulnerability (CVE-2021-29446) in jose-node-cjs-runtime arises from an observable timing discrepancy during the decryption process of AES_CBC_HMAC_SHA2 algorithms. When a padding error occurs while decrypting the ciphertext, there is a difference in timing that can be exploited by an attacker to perform a padding oracle attack. By leveraging this timing difference, an adversary could potentially decrypt data without knowledge of the decryption key. This attack requires issuing an average of 128*b calls to the padding oracle, where b is the number of bytes in the ciphertext block. The impact of this vulnerability is moderate, as it allows unauthorized access to encrypted data.
How To Fix
Latest published version: 5.10.0 as of 22 Oct 2026
npm install jose-node-cjs-runtime@5.10.0
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
3.11.4
This is the first release that contains the fix.
npm install jose-node-cjs-runtime@3.11.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Conclusion
In conclusion, the jose-node-cjs-runtime package is vulnerable to a padding oracle attack due to an observable timing discrepancy during decryption. Upgrading to version 3.11.4 or higher of the package is necessary to mitigate this vulnerability. It is crucial for users to update their installations promptly to ensure the security of their token-based authentication and data exchange systems. For further support and assistance with vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for jose-node-cjs-runtime →
FAQ
jose-node-cjs-runtime is an npm package that provides a JavaScript implementation of the JSON Object Signing and Encryption (JOSE) standards. It is commonly used for creating, signing, and encrypting JSON Web Tokens (JWTs) in secure authentication systems.
A padding oracle attack is a cryptographic attack that exploits the difference in timing or error messages resulting from padding validation in cryptographic systems. In this specific vulnerability, the timing discrepancy allows an attacker to decrypt data without knowing the decryption key.
The impact of this vulnerability is moderate. It allows an attacker to perform a padding oracle attack and potentially decrypt encrypted data without knowledge of the decryption key.
To fix this vulnerability, you should upgrade to version 3.11.4 or higher of jose-node-cjs-runtime. This version includes a patch that verifies the HMAC tag before performing CBC decryption, preventing the timing discrepancy that enables the padding oracle attack.
No, there is no known workaround for this vulnerability. It is recommended to upgrade to the fixed version of jose-node-cjs-runtime.