RSA PKCS#1 decryption vulnerability with prepending zeros in jsrsasign
Published 26 Jun 2020 · Updated 8 Nov 2023
Affected package
- Affected
- <8.0.18
- Fixed in
- 8.0.18
npm install jsrsasign@8.0.18Details
Impact
Jsrsasign supports RSA PKCS#1 v1.5 (i.e. RSAES-PKCS1-v1_5) and RSA-OAEP encryption and decryption. Its encrypted message is represented as BigInteger. When there is a valid encrypted message, a crafted message with prepending zeros can be decrypted by this vulnerability.
- If you don't use RSA PKCS1-v1_5 or RSA-OAEP decryption, this vulnerability is not affected.
- Risk to forge contents of encrypted message is very low.
- Risk to raise memory corruption is low since jsrsasign uses BigInteger class.
Patches
Users using RSA PKCS1-v1_5 or RSA-OAEP decryption should upgrade to 8.0.18.
Workarounds
Reject RSA PKCS1-v1_5 or RSA-OAEP encrypted message with unnecessary prepending zeros.
References
https://nvd.nist.gov/vuln/detail/CVE-2020-14967 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14967 https://vuldb.com/?id.157124 https://kjur.github.io/jsrsasign/api/symbols/KJUR.crypto.Cipher.html#.decrypt https://github.com/kjur/jsrsasign/issues/439
Is GHSA-xxxq-chmp-67g4 in any of your client repos?
Checking one package by hand is fine. Checking it across forty client projects is not. NPMscan reads the lockfiles in every GitHub repo you pick, finds each project with an affected jsrsasign, and gives you the command that fixes it.
References
- Linkgithub.com/kjur/jsrsasign/security/advisories/GHSA-xxxq-chmp-67g4
- Advisorynvd.nist.gov/vuln/detail/CVE-2020-14967
- Linkgithub.com/kjur/jsrsasign/issues/439
- Linkcve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14967
- Packagegithub.com/kjur/jsrsasign
- Linkgithub.com/kjur/jsrsasign/releases/tag/8.0.17
- Linkgithub.com/kjur/jsrsasign/releases/tag/8.0.18
- Linkkjur.github.io/jsrsasign
- Linkkjur.github.io/jsrsasign/api/symbols/KJUR.crypto.Cipher.html#.decrypt
- Linksecurity.netapp.com/advisory/ntap-20200724-0001
- Linkvuldb.com/?id.157124
- Linkwww.npmjs.com/package/jsrsasign
Advisory data from OSV.dev (opens OSV.dev in a new tab), refreshed daily.