Ecosyste.ms: Advisories

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

Security Advisories: GSA_kwCzR0hTQS1nbXY0LXI0MzgtcDY3Zs0v7g

Leading white space bypasses protocol validation

Impact

Whitespace characters are not removed from the beginning of the protocol, so URLs are not parsed properly and protocol validation mechanisms may fail.

Patches

Patched in 1.19.9

Workarounds

Remove leading whitespace from values before passing them to URI.parse (e.g. via .href(value) or new URI(value)), e.g. by using

function remove_whitespace(url){
     const whitespace = /^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/;
     url = url.replace(whitespace, '')
     return url
}

References

For more information

If you have any questions or comments about this advisory:

Permalink: https://github.com/advisories/GHSA-gmv4-r438-p67f
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS1nbXY0LXI0MzgtcDY3Zs0v7g
Source: GitHub Advisory Database
Origin: Unspecified
Severity: Moderate
Classification: General
Published: about 2 years ago
Updated: about 1 year ago


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

Identifiers: GHSA-gmv4-r438-p67f, CVE-2022-24723
References: Repository: https://github.com/medialize/URI.js
Blast Radius: 27.9

Affected Packages

npm:urijs
Dependent packages: 1,163
Dependent repositories: 187,610
Downloads: 7,906,985 last month
Affected Version Ranges: < 1.19.9
Fixed in: 1.19.9
All affected versions: 1.16.1, 1.17.0, 1.17.1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.18.6, 1.18.7, 1.18.8, 1.18.9, 1.18.10, 1.18.11, 1.18.12, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.19.6, 1.19.7, 1.19.8
All unaffected versions: 1.19.9, 1.19.10, 1.19.11