Disclosed vulnerabilities
CVE-2022-0686 Published: Apr 28, 2022

Authorization Bypass vulnerability in url-parse

9.1 Critical Severity authorization bypass javascript node nodejs npm SSRF
@r0hansh Reported by Checkmarx Zero

Summary

Authorization Bypass through user-controlled key in url-parse. When no port number is provided in the “url”, url-parse is unable to find the correct hostname.

Product

NPM url-parse prior to 1.5.8.

Impact

This issue may lead to SSRF, Open Redirect or any other vulnerability which depends on the hostname field of the parsed url.

Steps to reproduce

var PAYLOAD = "http://example.com:";

// Expected hostname: example.com
// Actual hostname by url-parse: example.com:
console.log(Url(PAYLOAD));

Expected result:

  slashes: true,
  protocol: 'http:',
  hash: '',
  query: '',
  pathname: '/',
  auth: '',
  host: 'example.com:',
  port: '',
  hostname: 'example.com:',
  password: '',
  username: '',
  origin: 'http://example.com:',
  href: 'http://example.com:/'
}

Remediation

Update url-parse to version 1.5.8.

Credit

This issue was reported by @r0hansh through huntr.dev.

Resources

  1. Disclosure
  2. d5c6479

Stay connected and never miss a research update!