---
title: "CX-2022-5001"
date: "2022-04-25T07:00:00+00:00"
url: "https://checkmarx.com/zero/vulnerabilities/cx-2022-5001/"
---

# CX-2022-5001

[Disclosed vulnerabilities](https://checkmarx.com/zero/vulnerabilities/)

CVE-2022-0512  **Published:** Apr 25, 2022

CWE-639 CWE-639 Authorization Bypass Through User-Controlled Key  5.3 Medium Severity authorization bypass javascript node nodejs npm

@ @ranjit-git  Reported by Checkmarx Zero

Details Overview

## Summary

Authorization bypass through user-controlled key in url-parse. It improperly handles username and password, and unable to detect the hostname.

## Product

NPM `url-parse` prior to 1.5.6.

## Impact

This issue may lead to the bypass of the `hostname` check.

## Steps to reproduce

`url-parse` was not able to verify basic authentication credentials and it also wrongly verifies the hostname. This allows to bypass the `hostname` validation.  
Let username be set as `admin`, password as `password123@` and hostname as `127.0.0.1`.  
The url will be `http://admin:password123@@127.0.0.1`.  
There is a blacklist check for domain `127.0.0.1` and every request to `127.0.0.1` will be blocked.

```var
var cc=parse("http://admin:password123@@127.0.0.1")
```

### Expected result:

```{
  protocol: 'http:',
  hash: '',
  query: '',
  pathname: '/',
  auth: 'admin:password123',
  host: '@127.0.0.1',
  port: '',
  hostname: '@127.0.0.1',
  password: 'password123',
  username: 'admin',
  origin: 'http://@127.0.0.1',
  href: 'http://admin:password123@@127.0.0.1/' }
```

Incorrret detection of auth, origin, password and hostname.  
Here hostname check `cc.hostname` is `@127.0.0.1` and also `cc.origin` is `http://@127.0.0.1` which will clearly bypass above `127.0.0.1` blacklist check.  
Now if you use `cc.href` to fetch url it will fetch `127.0.0.1`.

## Remediation

Update `url-parse` to version 1.5.6.

## Credit

This issue was reported by @ranjit-git through huntr.dev.

## Resources

1. [Disclosure](https://huntr.dev/bounties/6d1bc51f-1876-4f5b-a2c2-734e09e8e05b/)
2. [7b0b8a6](https://github.com/unshiftio/url-parse/commit/7b0b8a6671f806458e88b1f44feb0fdd742cdf06)

0  Medium Severity CVSS v3.1 Score

   5.3

CVSS v3.1 Vectors- Attack Vector: Network
- Attack Complexity: Low
- Privileges Required: None
- User Interaction: None
- Scope: Unchanged
- Confidentiality Impact: None
- Integrity Impact: Low
- Availability Impact: None

Advisory Timeline1. Disclosed Jan 7, 2022

## Explore more findings

[19 Nov 2026 CVE-2026-129292  PHP-FPM status endpoint XSS via unescaped user and script fields   5.3  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-129292/) [19 Nov 2026 CVE-2026-129538  PHP-CGI out-of-bounds read and write during PATH\_INFO correction   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-129538/) [22 Apr 2026 CVE-2026-42236  Unauthenticated Denial of Service in n8n via MCP Client Registration   8.7  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-4223/) [22 Apr 2026 CVE-2026-42230  n8n has Open Redirect in MCP OAuth Consent Flow   5.1  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-42230/) [27 Feb 2026 CVE-2026-27578  n8n Vulnerable to Stored XSS via Various Nodes   8.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27578/) [26 Feb 2026 CVE-2026-27950  Use-after-free in FreeRDP SDL2   5.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2026-27950/) [27 Nov 2025 CVE-2025-34281  Stored Cross-Site Scripting (XSS) in ThingsBoard   6.2  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-34281/) [17 Jan 2025 CVE-2025-0825  HTTP Response Splitting in cpp-httplib   6.9  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-0825/) [17 Jun 2025 CVE-2025-6050  Stored Cross-Site Scripting (XSS) in Mezzanine CMS Admin Interface   4.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2025-6050/) [12 Dec 2024 CVE-2024-8374  Code Injection in UltiMaker Cura   7.8  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-8374/) [14 Nov 2024 CVE-2024-52526  Stored Cross-site Scripting in @LibreNMS/LibreNMS Services Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-52526/) [14 Nov 2024 CVE-2024-51497  Stored Cross-site Scripting in @LibreNMS/LibreNMS Custom OID Tab   7.5  Visit the page](https://checkmarx.com/zero/vulnerabilities/cve-2024-51497/)
