fast-uri@4.2.2

Dependency-free RFC 3986 URI toolbox

  • latest version

    4.2.3

  • latest non vulnerable version

  • first published

    4 years ago

  • latest version published

    9 days ago

  • licenses detected

  • Direct Vulnerabilities

    Known vulnerabilities in the fast-uri package. This does not include vulnerabilities belonging to this package’s dependencies.

    Fix vulnerabilities automatically

    Snyk's AI Trust Platform automatically finds the best upgrade path and integrates with your development workflows. Secure your code at zero cost.

    Fix for free
    VulnerabilityVulnerable Version
    • M
    Path Equivalence

    fast-uri is a Dependency-free RFC 3986 URI toolbox

    Affected versions of this package are vulnerable to Path Equivalence via the serialize() / normalize() functions, which incorrectly applied RFC 3986 remove_dot_segments to relative-path references. That algorithm is defined only for merged target paths, not for relative references themselves, so normalizing a relative path such as a/../b produced /b (root-relative), x/.. produced /, and ../x produced x. An attacker who can supply a relative URI reference can cause it to resolve to a different resource than intended after normalization, enabling path-traversal-style target substitution.

    How to fix Path Equivalence?

    Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.

    <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3
    • M
    Improper Validation of Specified Quantity in Input

    fast-uri is a Dependency-free RFC 3986 URI toolbox

    Affected versions of this package are vulnerable to Improper Validation of Specified Quantity in Input via canonicalizeHost(), which passes the host directly to new URL('http://' + host) without verifying that the WHATWG parser consumed the entire input as a host. Because the RFC 3986 parser permits @ in the host component, and the WHATWG parser silently strips TAB, LF, and CR, an attacker can supply a URI whose authority is rewritten by the second parser with no error. This allows host spoofing across parse(), normalize(), equal(), and resolve() - for example, parse('http://a@b@evil.com/').host returns 'evil.com' and normalize('http://ev\til.com/p') returns 'http://evil.com/p'.

    How to fix Improper Validation of Specified Quantity in Input?

    Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.

    >=2.4.2 <2.4.8>=3.1.3 <3.1.9>=4.0.1 <4.2.3
    • M
    Encoding Error

    fast-uri is a Dependency-free RFC 3986 URI toolbox

    Affected versions of this package are vulnerable to Encoding Error via the decodeValidScheme function, which decoded percent-encoded URI schemes using the deprecated unescape() global (including the JavaScript-only %uXXXX form) before validating them. An attacker can supply a percent-encoded scheme such as %6Aavascript:alert(1) or %u006Aavascript:alert(1), causing normalize() to return a live javascript: URI, resolve() to produce a javascript: URL, and equal() to treat the encoded form as equivalent to the decoded scheme. This enables scheme-confusion attacks, most notably cross-site scripting when the resulting URI is used in a browser navigation or href context.

    How to fix Encoding Error?

    Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.

    <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3
    • M
    Path Equivalence

    fast-uri is a Dependency-free RFC 3986 URI toolbox

    Affected versions of this package are vulnerable to Path Equivalence via the serialize(), normalize(), and resolve() functions when called with the non-default option reference: 'suffix' on a reference that has no authority. A bare colon in the first path segment of the emitted relative reference is not escaped, violating RFC 3986 section 3.3/4.2, which causes the output to reparse as an absolute URI with a scheme rather than a relative reference. An attacker who can influence the URI being serialized can exploit this to inject an unintended scheme into the output.

    Note: This is only exploitable when the non-default reference: 'suffix' option is explicitly passed to serialize(), normalize(), or resolve().

    How to fix Path Equivalence?

    Upgrade fast-uri to version 2.4.8, 3.1.9, 4.2.3 or higher.

    <2.4.8>=3.0.0 <3.1.9>=4.0.0 <4.2.3