Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS04djM4LXB3NjItOWN3Ms0s1g

url-parse Incorrectly parses URLs that include an '@'

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,

parse(\"http://@/127.0.0.1\")

Will return:

{
 slashes: true,
 protocol: 'http:',
 hash: '',
 query: '',
 pathname: '/127.0.0.1',
 auth: '',
 host: '',
 port: '',
 hostname: '',
 password: '',
 username: '',
 origin: 'null',
 href: 'http:///127.0.0.1'
 }

If 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.

Permalink: https://github.com/advisories/GHSA-8v38-pw62-9cw2
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS04djM4LXB3NjItOWN3Ms0s1g
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: 7 months ago


CVSS Score: 6.5
CVSS vector: CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:N

Identifiers: GHSA-8v38-pw62-9cw2, CVE-2022-0639
References: Repository: https://github.com/unshiftio/url-parse
Blast Radius: 41.7

Affected Packages

npm:url-parse
Dependent packages: 2,573
Dependent repositories: 2,588,673
Downloads: 91,866,459 last month
Affected Version Ranges: < 1.5.7
Fixed in: 1.5.7
All affected versions: 0.0.0, 0.0.1, 0.0.2, 0.0.3, 0.0.4, 0.1.0, 0.1.1, 0.1.2, 0.1.3, 0.1.4, 0.1.5, 0.2.0, 0.2.1, 0.2.2, 0.2.3, 1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.1.5, 1.1.6, 1.1.7, 1.1.8, 1.1.9, 1.2.0, 1.3.0, 1.4.0, 1.4.1, 1.4.3, 1.4.4, 1.4.5, 1.4.6, 1.4.7, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.5.5, 1.5.6
All unaffected versions: 1.5.7, 1.5.8, 1.5.9, 1.5.10