jsrsasign RSA signature verification bypass

Severity: info · Published 2022-02-09

jsrsasign is a popular JavaScript library for cryptographic operations including RSA signature verification. A flaw in its PKCS#1 v1.5 signature parsing causes it to incorrectly accept invalid signatures as valid, potentially allowing forged signatures to be accepted if an application relies on this library for authentication or integrity checking.

Technologies: jsrsasign (npm). Vendors: npm.

Quick answers

Is This vulnerability exploited in the wild?
No. Junglewise Threat Intelligence has no report of This vulnerability being exploited in the wild.
How severe is This vulnerability?
Informational severity, published 9 February 2022.
Which products and versions are affected?
jsrsasign (npm) SEMVER:introduced=0,fixed=10.2.0.
Is there a fix for This vulnerability?
Yes. jsrsasign (npm): upgrade to 10.2.0 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.
How is This vulnerability attacked?
It is attacked over the network.
Am I affected?
Check whether you run jsrsasign (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

How to fix

  • jsrsasign (npm): upgrade to 10.2.0 or later
    npm install jsrsasign@10.2.0

Technical details

The vulnerability is a signature verification bypass in jsrsasign's RSA PKCS#1 v1.5 signature verification implementation (CWE-347: Improper Verification of Cryptographic Signature). The root cause is lenient parsing of the block type byte and padding bytes during signature verification, allowing malformed signatures to pass validation checks that should reject them. The vulnerability affects all versions through 10.1.13, with no authentication required—any code using the library's signature verification functions is potentially affected. While no known practical attack exists, an attacker could forge RSA signatures that would be incorrectly validated by applications using vulnerable versions. The fix was released in jsrsasign 10.2.0.

Affected products

  • jsrsasign jsrsasign before 10.2.0

Timeline

  • 2022-02-09: disclosed

References

This page as Markdown. Free to reuse under CC BY 4.0 with a link back.