GHSA-w74x-v6f9-j3xg: Medium severity npm/fast-uri vulnerability

Published Oct 23, 2026
·
Updated

Impact

fast-uri percent-decodes the scheme component with the legacy global unescape() before validating it, so an input whose decoded scheme is a valid but dangerous token is emitted as a live scheme. RFC 3986 section 3.1 does not allow percent-encoding in a scheme, so no RFC or WHATWG parser treats such input as having that scheme, but fast-uri does.

For example, normalize('%6Aavascript:alert(1)') returns javascript:alert(1), resolve('https://a.example/', '%6Aavascript:alert(1)') returns javascript:alert(1), and parse('%6Aavascript:alert(1)').scheme returns javascript. The %uXXXX form (%u006Aavascript:) produces the same result, and equal('%68ttp://a/', 'http://a/') returns true.

An application that screens dangerous schemes on the raw input and then stores or renders normalize(input) or resolve(base, input) turns an inert string into an executable javascript:, data:, or vbscript: URL, a stored or reflected cross-site scripting vector in the consuming application. equal() also treats an encoded and a plain scheme as the same, which can bypass equality-based allowlists.

Patches

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

Workarounds

Reject input whose scheme part (before the first :, and before any /, ?, or #) contains %. Alternatively, check parse(x).scheme against an allowlist after normalization and use that same parsed result rather than the raw string.

Affected Software

3 affected componentsFixes available
npm/fast-uri>=4.0.0<4.2.3
4.2.3
npm/fast-uri>=3.0.0<3.1.9
3.1.9
npm/fast-uri<2.4.8
2.4.8

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade npm/fast-uri to a version that resolves this vulnerability.

    Fixed in 4.2.3
  2. Upgrade

    Upgrade npm/fast-uri to a version that resolves this vulnerability.

    Fixed in 3.1.9
  3. Upgrade

    Upgrade npm/fast-uri to a version that resolves this vulnerability.

    Fixed in 2.4.8
  4. Upgrade

    Upgrade fast-uri to a version that resolves this vulnerability.

    Fixed in 2.4.8
  5. Compensating control

    Reject input whose scheme portion—before the first ':', and before any '/', '?' or '#'—contains '%'.

Event History

Oct 23, 2026
Advisory Published
via GitHub·09:41 PM
Data Sourced
via GitHub·09:41 PM
DescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

Which applications are realistically exposed to cross-site scripting from this issue?

Applications are exposed when they validate or block dangerous URL schemes on raw input, then store or render the output of fast-uri normalize() or resolve(). In that flow, an encoded scheme can become a live javascript:, data:, or vbscript: URL.

2

What input forms can trigger the scheme-validation bypass?

Percent-encoded scheme characters such as %6Aavascript: can be decoded into javascript:. The legacy %uXXXX form, such as %u006Aavascript:, has the same effect.

3

Can this bypass allowlists that compare URLs for equality?

Yes. fast-uri equal() can treat an encoded scheme and its plain equivalent as equal, as shown by %68ttp://a/ comparing equal to http://a/. Equality-based scheme or URL allowlists may therefore be bypassed.

4

What should be done to remediate the issue?

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

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203