CVE-2020-14967: RSA PKCS#1 decryption vulnerability in jsrsasign
Summary
CVE-2020-14967: RSA PKCS#1 decryption vulnerability with prepending zeros in jsrsasign. Affects jsrsasign versions < 8.0.18. Fixed in 8.0.18. 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
The jsrsasign package is an open-source library that provides various cryptographic functions for JavaScript applications. It includes support for RSA PKCS#1 v1.5 and RSA-OAEP encryption and decryption. These encryption schemes are commonly used for securing sensitive data in web applications.
Vulnerability Detail
This vulnerability in jsrsasign allows an attacker to decrypt a crafted message with prepending zeros. The vulnerability affects the RSA PKCS#1 v1.5 and RSA-OAEP decryption functionality of the library. By exploiting this vulnerability, an attacker can decrypt encrypted messages that should be secure. However, the risk of content forgery and memory corruption is low due to the use of the BigInteger class in jsrsasign.
How To Fix
Minimum fixed version
8.0.18
This is the first release that contains the fix.
npm install jsrsasign@8.0.18
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not feasible, a workaround is to reject RSA PKCS#1 v1.5 or RSA-OAEP encrypted messages with unnecessary prepending zeros. This can be done by implementing additional checks in the decryption process to detect and reject such messages.
Conclusion
The RSA PKCS#1 decryption vulnerability in jsrsasign can be mitigated by upgrading to version 8.0.18 or later. Alternatively, implementing the provided workaround can help reject vulnerable encrypted messages. It is important to take action to ensure the security of encrypted data in applications that use RSA PKCS#1 v1.5 or RSA-OAEP encryption. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for jsrsasign →
FAQ
The impact of this vulnerability is relatively low. While it allows for the decryption of crafted messages, the risk of content forgery and memory corruption is low. The vulnerability primarily affects the security of encrypted messages using RSA PKCS#1 v1.5 or RSA-OAEP encryption.
Users of the jsrsasign library who utilize RSA PKCS#1 v1.5 or RSA-OAEP decryption are affected by this vulnerability. Applications that do not use these encryption schemes are not affected.
To mitigate the risk, it is recommended to upgrade to the latest version of jsrsasign (8.0.18 or later) that includes a patch for this vulnerability. Alternatively, you can implement the provided workaround to reject encrypted messages with unnecessary prepending zeros.
There are no known exploits for this vulnerability at the time of this report. However, it is still important to apply the recommended fixes to ensure the security of encrypted messages.
You can find more information about this vulnerability in the National Vulnerability Database (NVD) entry: https://nvd.nist.gov/vuln/detail/CVE-2020-14967
References
Related vulnerabilities
Recent vulnerabilities recorded for jsrsasign.