9.1critical
RSA signature validation vulnerability on maleable encoded message in jsrsasign
- Severity
- 9.1critical CVSS:3.1 by NVD
- Exploit likelihood
- 0.96% (higher than 62% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- mitre
- Also known as
- GHSA-27fj-mc8w-j9wg
Description
In the jsrsasign package through 10.1.13 for Node.js, some invalid RSA PKCS#1 v1.5 signatures are mistakenly recognized to be valid. NOTE: there is no known practical attack.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Unspecified product | n/a | CVE List |
| jsrsasign (npm) | before 10.2.0 | GitHub Advisory Database |
| kjur jsrsasign | up to 10.1.13 | NVD |
All scores
| GitHub | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 9.1critical CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:N |
| NVD | 6.4medium CVSS:2.0 | AV:N/AC:L/Au:N/C:P/I:P/A:N |
Classification
What each source says
CVE List
In the jsrsasign package through 10.1.13 for Node.js, some invalid RSA PKCS#1 v1.5 signatures are mistakenly recognized to be valid. NOTE: there is no known practical attack.
GitHub Advisory Database
Impact
Vulnerable jsrsasign will accept RSA signature with improper PKCS#1.5 padding.
Decoded RSA signature value consists following form:
01(ff...(8 or more ffs)...ff)00[ASN.1 OF DigestInfo]
Its byte length must be the same as RSA key length, however such checking was not sufficient.
To make crafted message for practical attack is very hard.
Patches
Users validating RSA signature should upgrade to 10.2.0 or later.
Workarounds
There is no workaround. Not to use RSA signature validation in jsrsasign.
ACKNOWLEDGEMENT
Thanks to Daniel Yahyazadeh @yahyazadeh for reporting and analyzing this vulnerability.
NVD (es)
En el paquete jsrsasign versiones hasta 10.1.13 para Node.js, algunas firmas RSA PKCS#1 v1.5, firmas son erróneamente reconocidas como válidas. NOTA: No es conocido un ataque práctico
References
| https://kjur.github.io/jsrsasign/ | release-notes, third-party-advisory | |
| https://github.com/kjur/jsrsasign/issues/478 | third-party-advisory, web | |
| https://github.com/kjur/jsrsasign/releases/tag/10.1.13 | release-notes, third-party-advisory, web | |
| https://github.com/kjur/jsrsasign/security/advisories/GHSA-27fj-mc8w-j9wg | web | |
| https://nvd.nist.gov/vuln/detail/CVE-2021-30246 | advisory | |
| https://kjur.github.io/jsrsasign | web | |
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2021-30246 changed 2024-08-03 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-27fj-mc8w-j9wg changed 2023-11-08 | CC-BY-4.0 |
| NVD | CVE-2021-30246 changed 2026-06-22 | Public domain |