GHSA-wxgw-qj99-44c2: Node forge Prototype Pollution Vulnerability

LOW
Published
Advisory Summary

GHSA-wxgw-qj99-44c2 is a LOW prototype pollution vulnerability (General Security Weakness) affecting Node forge libraries in the npm ecosystem. The issue involves prototype pollution in node-forge util.setpath api. Remediation is available by upgrading affected packages to version 0.10.0.

GHSA-wxgw-qj99-44c2 at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-wxgw-qj99-44c2
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification General Security Weakness
Affected Product Node forge
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-wxgw-qj99-44c2

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

node-forge fixed: 0.10.0
npm install node-forge@0.10.0
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 node-forge

How to Check if You Are Affected

To determine whether your Node.js application is affected by GHSA-wxgw-qj99-44c2, inspect your project dependencies using npm:

npm ls node-forge

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

Note: The npm ls node-forge 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 General Security Weakness. In Node forge, 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 `forge.util.setPath` had a potential prototype pollution issue if called with untrusted keys. This API was not used by forge itself. ### Patches The `forge.util.setPath` API and related functions were removed in 0.10.0. ### Workarounds Don't call `forge.util.setPath` directly or indirectly with untrusted keys. ### References - https://security.snyk.io/vuln/SNYK-JS-NODEFORGE-598677 - https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720 ### For more information If you have any questions or comments about this advisory: * Open an issue in [forge](https://github.com/digitalbazaar/forge). * Email us at support@digitalbazaar.com.

GHSA-wxgw-qj99-44c2 Affected Node forge Versions

1 component(s)
Fixed Versions:
0.10.0
Product / Package Ecosystem Affected Versions Fixed Version
node-forge
npm
< 0.10.0
0.10.0

References

Frequently Asked Questions

What is GHSA-wxgw-qj99-44c2?
GHSA-wxgw-qj99-44c2 is a security vulnerability in Node forge involving Prototype Pollution in node-forge util.setPath API under General Security Weakness.
Which Node forge versions are affected?
Affected versions include releases prior to 0.10.0 across affected packages: node-forge.
What version fixes GHSA-wxgw-qj99-44c2?
Upgrading to 0.10.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is node-forge affected?
Yes, node-forge is affected in releases prior to 0.10.0. Upgrade your dependency to 0.10.0 or later.
What CWE is associated with GHSA-wxgw-qj99-44c2?
GHSA-wxgw-qj99-44c2 is classified under General Security Weakness.
How can I check npm dependencies for GHSA-wxgw-qj99-44c2?
Run the dependency tree command: 'npm ls node-forge'. 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-wxgw-qj99-44c2",
  "modified" : "2022-01-07T22:20:50Z",
  "published" : "2022-01-08T00:22:40Z",
  "aliases" : [ ],
  "summary" : "Prototype Pollution in node-forge util.setPath API",
  "details" : "### Impact\n`forge.util.setPath` had a potential prototype pollution issue if called with untrusted keys. This API was not used by forge itself.\n\n### Patches\nThe `forge.util.setPath` API and related functions were removed in 0.10.0.\n\n### Workarounds\nDon't call `forge.util.setPath` directly or indirectly with untrusted keys.\n\n### References\n- https://security.snyk.io/vuln/SNYK-JS-NODEFORGE-598677\n- https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-7720\n\n### For more information\nIf you have any questions or comments about this advisory:\n* Open an issue in [forge](https://github.com/digitalbazaar/forge).\n* Email us at support@digitalbazaar.com.",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-forge"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "0.10.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge/security/advisories/GHSA-wxgw-qj99-44c2"
  } ],
  "database_specific" : {
    "cwe_ids" : [ ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-07T22:20:50Z",
    "nvd_published_at" : null
  }
}