CVE-2020-14968: Jsrsasign RSA-PSS Signature Validation Vulnerability By Vulnerability

CRITICAL
Advisory Identifier: GHSA-q3gh-5r98-j4h3
CVSS 9.8
CWE-119
Published
Advisory Summary

CVE-2020-14968 is a CRITICAL (CVSS 9.8) rsa-pss signature validation vulnerability by vulnerability (CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer) affecting Jsrsasign libraries in the npm ecosystem. The issue involves rsa-pss signature validation vulnerability by prepending zeros in jsrsasign. Remediation is available by upgrading affected packages to version 8.0.17.

CVE-2020-14968 at a Glance

CVE Identifier CVE-2020-14968
GHSA Identifier GHSA-q3gh-5r98-j4h3
Severity CRITICAL
CVSS v3.1 Base Score 9.8
CWE Classification CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer
Affected Product Jsrsasign
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 9.8

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity High (I:H)
Availability High (A:H)

How to Fix CVE-2020-14968

To remediate this vulnerability, upgrade all affected Jsrsasign dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

jsrsasign fixed: 8.0.17
npm install jsrsasign@8.0.17
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls jsrsasign

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2020-14968, inspect your project dependencies using npm:

npm ls jsrsasign

Analyze the terminal output to locate any version of Jsrsasign in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 8.0.17), your application is affected.

Note: The npm ls jsrsasign command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer, where the product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. this may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data. In Jsrsasign, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Impact Jsrsasign can verify RSA-PSS signature which value can expressed as BigInteger. When there is a valid RSA-PSS signature value, this vulnerability is also accept value with prepending zeros as a valid signature. - If you are not use RSA-PSS signature validation, this vulnerability is not affected. - Risk to accept a forged or crafted message to be signed is low. - Risk to raise memory corruption is low since jsrsasign uses BigInteger class. ### Patches Users using RSA-PSS signature validation should upgrade to 8.0.17. ### Workarounds Reject RSA-PSS signatures with unnecessary prepending zeros. ### References https://github.com/kjur/jsrsasign/security/advisories/GHSA-q3gh-5r98-j4h3 [https://github.com/kjur/jsrsasign/issues/438](https://github.com/kjur/jsrsasign/issues/438) https://nvd.nist.gov/vuln/detail/CVE-2020-14968 https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14968 https://vuldb.com/?id.157125 https://kjur.github.io/jsrsasign/api/symbols/RSAKey.html#.verifyWithMessageHashPSS

CVE-2020-14968 Affected Jsrsasign Versions

1 component(s)
Fixed Versions:
8.0.17
Product / Package Ecosystem Affected Versions Fixed Version
jsrsasign
npm
≥ 3.0.0
< 8.0.17
8.0.17

References

Frequently Asked Questions

What is CVE-2020-14968?
CVE-2020-14968 is a security vulnerability in Jsrsasign involving RSA-PSS signature validation vulnerability by prepending zeros in jsrsasign under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer.
Which Jsrsasign versions are affected?
Affected versions include releases prior to 8.0.17 across affected packages: jsrsasign.
What version fixes CVE-2020-14968?
Upgrading to 8.0.17 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jsrsasign affected?
Yes, jsrsasign is affected in releases prior to 8.0.17. Upgrade your dependency to 8.0.17 or later.
What is the CVSS score of CVE-2020-14968?
CVE-2020-14968 has a CVSS v3.1 base score of 9.8 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2020-14968?
CVE-2020-14968 is classified under CWE-119: Improper Restriction of Operations within the Bounds of a Memory Buffer (The product performs operations on a memory buffer, but it reads from or writes to a memory location outside the buffer's intended boundary. This may result in read or write operations on unexpected memory locations that could be linked to other variables, data structures, or internal program data.).
How can I check npm dependencies for CVE-2020-14968?
Run the dependency tree command: 'npm ls jsrsasign'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-q3gh-5r98-j4h3",
  "modified" : "2023-01-27T21:41:14Z",
  "published" : "2020-06-26T16:26:50Z",
  "aliases" : [ "CVE-2020-14968" ],
  "summary" : "RSA-PSS signature validation vulnerability by prepending zeros in jsrsasign",
  "details" : "### Impact\nJsrsasign can verify RSA-PSS signature which value can expressed as BigInteger. When there is a valid RSA-PSS signature value, this vulnerability is also accept value with prepending zeros as a valid signature.\n\n- If you are not use RSA-PSS signature validation, this vulnerability is not affected. \n- Risk to accept a forged or crafted message to be signed is low.\n- Risk to raise memory corruption is low since jsrsasign uses BigInteger class.\n\n### Patches\nUsers using RSA-PSS signature validation should upgrade to 8.0.17.\n\n### Workarounds\nReject RSA-PSS signatures with unnecessary prepending zeros.\n\n### References\nhttps://github.com/kjur/jsrsasign/security/advisories/GHSA-q3gh-5r98-j4h3\n[https://github.com/kjur/jsrsasign/issues/438](https://github.com/kjur/jsrsasign/issues/438)\nhttps://nvd.nist.gov/vuln/detail/CVE-2020-14968\nhttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14968\nhttps://vuldb.com/?id.157125\nhttps://kjur.github.io/jsrsasign/api/symbols/RSAKey.html#.verifyWithMessageHashPSS\n\n",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "jsrsasign"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "8.0.17"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "< 8.0.16"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/security/advisories/GHSA-q3gh-5r98-j4h3"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-14968"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/issues/438"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/commit/3bcc088c727658d7235854cd2a409a904cc2ce99"
  }, {
    "type" : "WEB",
    "url" : "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14968"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/kjur/jsrsasign"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/releases/tag/8.0.17"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/releases/tag/8.0.18"
  }, {
    "type" : "WEB",
    "url" : "https://kjur.github.io/jsrsasign"
  }, {
    "type" : "WEB",
    "url" : "https://kjur.github.io/jsrsasign/api/symbols/RSAKey.html#.verifyWithMessageHashPSS"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200724-0001"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.157125"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/advisories/1541"
  }, {
    "type" : "WEB",
    "url" : "https://www.npmjs.com/package/jsrsasign"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-119" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2020-06-26T16:19:52Z",
    "nvd_published_at" : "2020-06-22T12:15:00Z"
  }
}