fast-uri@4.1.4

Dependency-free RFC 3986 URI toolbox

  • latest version

    4.2.3

  • latest non vulnerable version

  • first published

    4 years ago

  • latest version published

    25 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
    • M
    Inappropriate Encoding for Output Context

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

    Affected versions of this package are vulnerable to Inappropriate Encoding for Output Context in the mailto parser when handling percent-encoded query field names. An attacker can manipulate email recipients, subjects, or body content by crafting specially formatted mailto URIs that exploit the desynchronization between parsing and serialization. This may result in emails being sent to unintended recipients or with altered content.

    How to fix Inappropriate Encoding for Output Context?

    Upgrade fast-uri to version 4.1.5 or higher.

    >=4.1.3 <4.1.5
    • M
    Encoding Error

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

    Affected versions of this package are vulnerable to Encoding Error in the mailto parser process. An attacker can inject unauthorized recipients or manipulate the subject and body fields by crafting a URI with percent-encoded reserved field names, which are not properly recognized during parsing but are re-emitted as literal field names upon serialization. This can result in attacker-controlled data being silently included in outgoing messages or logs.

    How to fix Encoding Error?

    Upgrade fast-uri to version 4.1.5 or higher.

    >=4.1.3 <4.1.5
    • M
    Improper Handling of Case Sensitivity

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

    Affected versions of this package are vulnerable to Improper Handling of Case Sensitivity due to inconsistent normalization in the host component. An attacker can gain unauthorized access to restricted resources or services by submitting a specially crafted URI containing percent-encoded uppercase characters, which may bypass host allowlists or denylists in applications relying on case-sensitive host validation.

    How to fix Improper Handling of Case Sensitivity?

    Upgrade fast-uri to version 2.4.7, 3.1.8, 4.1.5 or higher.

    <2.4.7>=3.0.0 <3.1.8>=4.0.0 <4.1.5