CVE-2022-2217: Cross site scripting in parse-url
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.55109%
CWE
Published
6/28/2022
Updated
1/27/2023
KEV Status
No
Technology
JavaScript
Technical Details
CVSS Vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:L/I:L/A:N
Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
---|---|---|---|
parse-url | npm | < 6.0.1 | 6.0.1 |
Vulnerability Intelligence
Miggo AI
Root Cause Analysis
The XSS vulnerability stems from improper handling of URL parsing in git-ssh formats. The commit 21c72ab introduced a regex (GIT_RE) to better handle these cases, indicating the previous implementation lacked proper validation. The parseUrl function directly processes user-controlled URLs and returns parsed components (pathname, resource, etc.) that could contain untrusted input. When these components are used in web output without proper encoding, XSS occurs. The function's role as the primary URL parser and the security-focused patch targeting its git-ssh handling make it the clear vulnerability source.