CVE-2020-14967: Jsrsasign RSA PKCS#1 Decryption Vulnerability With Vulnerability

CRITICAL
Advisory Identifier: GHSA-xxxq-chmp-67g4
CVSS 9.8
CWE-119
Published
Advisory Summary

CVE-2020-14967 is a CRITICAL (CVSS 9.8) rsa pkcs#1 decryption vulnerability with 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 pkcs#1 decryption vulnerability with prepending zeros in jsrsasign. Remediation is available by upgrading affected packages to version 8.0.18.

CVE-2020-14967 at a Glance

CVE Identifier CVE-2020-14967
GHSA Identifier GHSA-xxxq-chmp-67g4
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-14967

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.18
npm install jsrsasign@8.0.18
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-14967, 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.18), 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 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

CVE-2020-14967 Affected Jsrsasign Versions

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

References

Frequently Asked Questions

What is CVE-2020-14967?
CVE-2020-14967 is a security vulnerability in Jsrsasign involving RSA PKCS#1 decryption vulnerability with 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.18 across affected packages: jsrsasign.
What version fixes CVE-2020-14967?
Upgrading to 8.0.18 (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.18. Upgrade your dependency to 8.0.18 or later.
What is the CVSS score of CVE-2020-14967?
CVE-2020-14967 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-14967?
CVE-2020-14967 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-14967?
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-xxxq-chmp-67g4",
  "modified" : "2023-01-31T01:29:40Z",
  "published" : "2020-06-26T16:27:08Z",
  "aliases" : [ "CVE-2020-14967" ],
  "summary" : "RSA PKCS#1 decryption vulnerability with prepending zeros in jsrsasign",
  "details" : "### Impact\nJsrsasign 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.\n\n- If you don't use RSA PKCS1-v1_5 or RSA-OAEP decryption, this vulnerability is not affected.\n- Risk to forge contents of encrypted message is very low.\n- Risk to raise memory corruption is low since jsrsasign uses BigInteger class.\n\n### Patches\nUsers using RSA PKCS1-v1_5 or RSA-OAEP decryption should upgrade to 8.0.18.\n\n### Workarounds\nReject RSA PKCS1-v1_5 or RSA-OAEP encrypted message with unnecessary prepending zeros.\n\n### References\nhttps://nvd.nist.gov/vuln/detail/CVE-2020-14967\nhttps://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14967\nhttps://vuldb.com/?id.157124\nhttps://kjur.github.io/jsrsasign/api/symbols/KJUR.crypto.Cipher.html#.decrypt\nhttps://github.com/kjur/jsrsasign/issues/439\n\n\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" : "0"
      }, {
        "fixed" : "8.0.18"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/security/advisories/GHSA-xxxq-chmp-67g4"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2020-14967"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/kjur/jsrsasign/issues/439"
  }, {
    "type" : "WEB",
    "url" : "https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-14967"
  }, {
    "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/KJUR.crypto.Cipher.html#.decrypt"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20200724-0001"
  }, {
    "type" : "WEB",
    "url" : "https://vuldb.com/?id.157124"
  }, {
    "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:26:32Z",
    "nvd_published_at" : "2020-06-22T12:15:00Z"
  }
}