Open Redirect Affecting node-forge package, versions <1.0.0


0.0
medium

Snyk CVSS

    Attack Complexity Low

    Threat Intelligence

    Exploit Maturity Proof of concept
    EPSS 0.07% (29th percentile)
Expand this section
NVD
6.1 medium

Do your applications use this vulnerable package?

In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.

Test your applications
  • Snyk ID SNYK-JS-NODEFORGE-2330875
  • published 6 Jan 2022
  • disclosed 6 Jan 2022
  • credit ready-research

How to fix?

Upgrade node-forge to version 1.0.0 or higher.

Overview

node-forge is a JavaScript implementations of network transports, cryptography, ciphers, PKI, message digests, and various utilities.

Affected versions of this package are vulnerable to Open Redirect via parseUrl function when it mishandles certain uses of backslash such as https:/\/\/\ and interprets the URI as a relative path.

PoC:


// poc.js
var forge = require("node-forge");
var url = forge.util.parseUrl("https:/\/\/\www.github.com/foo/bar");
console.log(url);

// Output of node poc.js:

{ full: 'https://', scheme: 'https', host: '', port: 443, path: '/www.github.com/foo/bar&#39;, <<<---- path should be "/foo/bar" fullHost: '' }