CVE-2022-2218:
Cross site scripting in parse-url
6.1
CVSS Score
3.1
Basic Information
CVE ID
GHSA ID
EPSS Score
0.57221%
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 vulnerability stems from how parseUrl
handles git-style URLs. The commit adds special handling for 'file' protocol URLs with a regex that extracts pathname components. Before the patch, this pathname value (derived directly from user input) wasn't properly sanitized when returned in parsed URL components. If applications using this library rendered these parsed values without HTML escaping (e.g., displaying resource/pathname
in UI), stored XSS could occur. The patch introduces protocol normalization but shows evidence of pathname manipulation that was previously vulnerable.