GHSA-gf8q-jrpm-jvxq: Node forge URL Parsing Vulnerability

LOW
CWE-601
Published
Advisory Summary

GHSA-gf8q-jrpm-jvxq is a LOW url parsing vulnerability (CWE-601: URL Redirection to Untrusted Site ('Open Redirect')) affecting Node forge libraries in the npm ecosystem. The issue involves url parsing in node-forge could lead to undesired behavior.. Remediation is available by upgrading affected packages to version 1.0.0.

GHSA-gf8q-jrpm-jvxq at a Glance

CVE Identifier N/A
GHSA Identifier GHSA-gf8q-jrpm-jvxq
Severity LOW
CVSS v3.1 Base Score N/A
CWE Classification CWE-601: URL Redirection to Untrusted Site ('Open Redirect')
Affected Product Node forge
Package Ecosystem npm
Published Date
Last Updated

How to Fix GHSA-gf8q-jrpm-jvxq

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: 1.0.0
npm install node-forge@1.0.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-gf8q-jrpm-jvxq, 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 1.0.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 CWE-601: URL Redirection to Untrusted Site ('Open Redirect'), where the web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect. 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 The regex used for the `forge.util.parseUrl` API would not properly parse certain inputs resulting in a parsed data structure that could lead to undesired behavior. ### Patches `forge.util.parseUrl` and other very old related URL APIs were removed in 1.0.0 in favor of letting applications use the more modern WHATWG URL Standard API. ### Workarounds Ensure code does not directly or indirectly call `forge.util.parseUrl` with untrusted input. ### References - https://www.huntr.dev/bounties/41852c50-3c6d-4703-8c55-4db27164a4ae/ ### 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-gf8q-jrpm-jvxq Affected Node forge Versions

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

References

Frequently Asked Questions

What is GHSA-gf8q-jrpm-jvxq?
GHSA-gf8q-jrpm-jvxq is a security vulnerability in Node forge involving URL parsing in node-forge could lead to undesired behavior. under CWE-601: URL Redirection to Untrusted Site ('Open Redirect').
Which Node forge versions are affected?
Affected versions include releases prior to 1.0.0 across affected packages: node-forge.
What version fixes GHSA-gf8q-jrpm-jvxq?
Upgrading to 1.0.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 1.0.0. Upgrade your dependency to 1.0.0 or later.
What CWE is associated with GHSA-gf8q-jrpm-jvxq?
GHSA-gf8q-jrpm-jvxq is classified under CWE-601: URL Redirection to Untrusted Site ('Open Redirect') (The web application accepts a user-controlled input that specifies a link to an external site, and uses that link in a redirect.).
How can I check npm dependencies for GHSA-gf8q-jrpm-jvxq?
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-gf8q-jrpm-jvxq",
  "modified" : "2022-01-07T22:20:43Z",
  "published" : "2022-01-08T00:22:02Z",
  "aliases" : [ ],
  "summary" : "URL parsing in node-forge could lead to undesired behavior.",
  "details" : "### Impact\nThe regex used for the `forge.util.parseUrl` API would not properly parse certain inputs resulting in a parsed data structure that could lead to undesired behavior.\n\n### Patches\n`forge.util.parseUrl` and other very old related URL APIs were removed in 1.0.0 in favor of letting applications use the more modern WHATWG URL Standard API.\n\n### Workarounds\nEnsure code does not directly or indirectly call `forge.util.parseUrl` with untrusted input.\n\n### References\n- https://www.huntr.dev/bounties/41852c50-3c6d-4703-8c55-4db27164a4ae/\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\n",
  "severity" : [ ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "node-forge"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.0"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge/security/advisories/GHSA-gf8q-jrpm-jvxq"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0122"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/digitalbazaar/forge"
  }, {
    "type" : "WEB",
    "url" : "https://www.huntr.dev/bounties/41852c50-3c6d-4703-8c55-4db27164a4ae"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-601" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2022-01-07T22:20:43Z",
    "nvd_published_at" : null
  }
}