Junglewise Threat Intelligence

CVE-2020-14966: jsrsasign ECDSA signature validation ASN.1 encoding bypass

CVE-2020-14966 · Severity: low · CVSS 3.1 · Published 2020-06-26

Technologies: jsrsasign (npm). Vendors: npm.

Executive brief

jsrsasign is a JavaScript cryptography library that validates ECDSA digital signatures, a security mechanism used to verify message authenticity. The library accepts malformed or non-standard ASN.1 encodings of ECDSA signatures that should be rejected, allowing an attacker to forge valid-looking signatures for messages they did not authorize. This could enable attackers to impersonate legitimate users or systems in applications relying on this library for signature validation.

Technical details

The vulnerability is a signature validation bypass caused by insufficient ASN.1 DER (Distinguished Encoding Rules) validation in ECDSA signature processing. The library accepts non-canonical ASN.1 encodings including: multi-byte length fields that are unnecessarily padded, leading zeros in INTEGER values, and trailing zeros appended to the signature structure. ECDSA signatures are network-reachable and no authentication is required for exploitation. An attacker can craft malformed but "semantically equivalent" signatures that will be accepted as valid, bypassing signature verification. The fix involves strict ASN.1 DER checking; users should upgrade to jsrsasign 8.0.19 or later. The risk is primarily an integrity issue (signature forgery) rather than memory corruption, as the library uses BigInteger classes that are not susceptible to overflow attacks.

Affected products

  • jsrsasign jsrsasign 4.0.0 to 8.0.18

Timeline

  • 2020-06-22: disclosed
  • 2020-06-23: advisory
  • 2020-06-22: patched: Fixed in version 8.0.19

References

Related threats