Packages / fast-uri / Security
fast-uri vulnerable to path traversal via percent-encoded dot segments
Affected releases · fast-uri
- 3.x3.0.0 – 3.1.0Fixed in 3.1.1
- 2.x2.0.0 – 2.4.0Fixed in 2.4.1
- 1.x and older0.0.1 – 1.0.1No fix, no longer updated
On 3.x, the newest line:
npm install fast-uri@3.1.1Every release on a timeline
Not affected
4.0.0 – 4.2.3
12 releases, latest
Affected
3.0.0 – 3.1.0
8 releases
Fixed
3.1.1 – 3.1.9
9 releases
Affected
2.0.0 – 2.4.0
6 releases
Fixed
2.4.1 – 2.4.8
8 releases
Affected
1.0.0 – 1.0.1
2 releases
Affected
0.0.1 – 0.0.2
2 releases
What happens
Impact
fast-uri v3.1.0 and earlier decodes percent-encoded path separators (%2F) and dot segments (%2E) before applying dot-segment removal in normalize() and equal(). This makes encoded path data behave like real / and .., so distinct URIs collapse onto the same normalized path.
For example, http://example.com/public/%2e%2e/admin normalizes to http://example.com/admin, and equal() considers them the same URI.
Applications that normalize or compare attacker-controlled URLs to enforce path-based policy can be bypassed. A path that looks confined under an allowed prefix can normalize to a different location.
Patches
Upgrade to fast-uri >= 3.1.1, or if you are in the v2.x release line, v2.4.1
Workarounds
None. Upgrade to the patched version.
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.