fix: backport GHSA-q3j6-qgpj-74h6 and GHSA-v39h-62p7-jpjc to v2.x - #187
Merged
Conversation
…p7-jpjc Preserve reserved path escapes (%2F, %2E) during normalize/equal so percent-encoded dot segments cannot bypass path-based policy checks (GHSA-q3j6-qgpj-74h6 / CVE-2026-6321). Re-escape authority gen-delims in host after decode, and leave malformed authority/port inputs unchanged under normalize/equal so encoded delimiters cannot rewrite authority (GHSA-v39h-62p7-jpjc / CVE-2026-6322). Backported from v3.1.1 and v3.1.2.
Member
Author
|
@UlisesGascon would you take care of updating the OpenJS records once this lands? |
Member
Author
|
Unfortunately, I have v2 of fast-uri in the dependency tree :(. Sigh. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Backports the security fixes for:
%2E%2E,%2F)%40,%3A, …)These were originally fixed in
v3.1.1andv3.1.2. Thev2.xline (<= 2.4.0) is still vulnerable.Changes
parse/normalize/equal/serializeso encoded separators and dot segments stay data, not live path syntaxunescape()so authority structure cannot be rewrittenerror; leave such string inputs unchanged innormalize(); returnfalsefromequal()when either side is malformedFollow-up
After merge, publish a
2.4.1(or next patch) and update both GHSAs to list the new2.xpatched version alongside3.1.1/3.1.2.Test plan
npm run test:unit(includes new security regression tests)npm run test:lintnormalize('http://example.com/public/%2e%2e/admin')→ keeps%2E%2Eequal(...%2e%2e/admin, .../admin)→falsenormalize('http://trusted.com%40evil.com/')→ preserves%40parse('http://trusted.com%40evil.com/').host→trusted.com%40evil.com