Vulnerabilities in pkg:npm/url-parse
PACKAGECVE-2022-0639 is a MODERATE (CVSS 6.5) url-parse incorrectly parses urls that vulnerability (CWE-639: Authorization Bypass Through User-Controlled Key) affecting Url parse libraries in the npm ecosystem. The issue involves url-parse incorrectly parses urls that include an '@'. Remediation is available by upgrading affected packages to version 1.5.7.
pkg:npm/url-parse
Vulnerability advisories affecting package pkg:npm/url-parse. Select an advisory below to view technical details or fixes.
| Advisory ID | CVE / NVD | Severity | Summary |
|---|---|---|---|
| GHSA-8v38-pw62-9cw2 | CVE-2022-0639 | MODERATE | url-parse Incorrectly parses URLs that include an '@' |
| GHSA-rqff-837h-mm52 | CVE-2022-0512 | MODERATE | Authorization bypass in url-parse |
| GHSA-46c4-8wrp-j99v | CVE-2020-8124 | MODERATE | Improper Validation and Sanitization in url-parse |
| GHSA-hh27-ffr2-f2jc | CVE-2021-3664 | MODERATE | Open redirect in url-parse |
| GHSA-9m6j-fcg5-2442 | CVE-2021-27515 | MODERATE | Path traversal in url-parse |
| GHSA-jf5r-8hm2-f872 | CVE-2022-0691 | MODERATE | url-parse incorrectly parses hostname / protocol due to unstripped leading control characters. |
| GHSA-pv4c-p2j5-38j4 | CVE-2018-3774 | CRITICAL | Open Redirect in url-parse |
| GHSA-hgjh-723h-mx2j | CVE-2022-0686 | CRITICAL | Authorization Bypass Through User-Controlled Key in url-parse |
CVE-2022-0639 at a Glance
Security Impact
CVSS: 6.5
The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N).
How to Fix CVE-2022-0639
To remediate this vulnerability, upgrade all affected Url parse dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
npm install url-parse@1.5.7
Run the following command in your project directory to verify that all resolved dependencies use the patched release:
npm ls url-parse
How to Check if You Are Affected
To determine whether your Node.js application is affected by CVE-2022-0639, inspect your project dependencies using npm:
npm ls url-parse
Analyze the terminal output to locate any version of Url parse in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.5.7), your application is affected.
Note: The npm ls url-parse 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-639: Authorization Bypass Through User-Controlled Key, where the system's authorization functionality does not prevent one user from gaining access to another user's data or record by modifying the key value identifying the data. In Url parse, 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
CVE-2022-0639 Affected Url parse Versions
1 component(s)| Product / Package | Ecosystem | Affected Versions | Fixed Version |
|---|---|---|---|
|
url-parse
|
npm |
≥ 1.0.0
< 1.5.7
|
1.5.7
|
References
Frequently Asked Questions
What is CVE-2022-0639?
Which Url parse versions are affected?
What version fixes CVE-2022-0639?
Is url-parse affected?
What is the CVSS score of CVE-2022-0639?
What CWE is associated with CVE-2022-0639?
How can I check npm dependencies for CVE-2022-0639?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-8v38-pw62-9cw2",
"modified" : "2026-02-20T19:56:16Z",
"published" : "2022-02-18T00:00:33Z",
"aliases" : [ "CVE-2022-0639" ],
"summary" : "url-parse Incorrectly parses URLs that include an '@'",
"details" : "A specially crafted URL with an '@' sign but empty user info and no hostname, when parsed with url-parse, url-parse will return the incorrect href. In particular,\n\n```js\nparse(\\\"http://@/127.0.0.1\\\")\n```\nWill return:\n```yaml\n{\n slashes: true,\n protocol: 'http:',\n hash: '',\n query: '',\n pathname: '/127.0.0.1',\n auth: '',\n host: '',\n port: '',\n hostname: '',\n password: '',\n username: '',\n origin: 'null',\n href: 'http:///127.0.0.1'\n }\n```\nIf the 'hostname' or 'origin' attributes of the output from url-parse are used in security decisions and the final 'href' attribute of the output is then used to make a request, the decision may be incorrect.",
"severity" : [ {
"type" : "CVSS_V3",
"score" : "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N"
} ],
"affected" : [ {
"package" : {
"ecosystem" : "npm",
"name" : "url-parse"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "1.0.0"
}, {
"fixed" : "1.5.7"
} ]
} ]
} ],
"references" : [ {
"type" : "ADVISORY",
"url" : "https://nvd.nist.gov/vuln/detail/CVE-2022-0639"
}, {
"type" : "WEB",
"url" : "https://github.com/unshiftio/url-parse/commit/ef45a1355375a8244063793a19059b4f62fc8788"
}, {
"type" : "PACKAGE",
"url" : "https://github.com/unshiftio/url-parse"
}, {
"type" : "WEB",
"url" : "https://huntr.dev/bounties/83a6bc9a-b542-4a38-82cd-d995a1481155"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2023/02/msg00030.html"
}, {
"type" : "WEB",
"url" : "https://lists.debian.org/debian-lts-announce/2025/12/msg00024.html"
} ],
"database_specific" : {
"cwe_ids" : [ "CWE-639" ],
"severity" : "MODERATE",
"github_reviewed" : true,
"github_reviewed_at" : "2022-02-22T18:08:05Z",
"nvd_published_at" : "2022-02-17T18:15:00Z"
}
}