Repository navigation
Conversation
Owner
|
This security issue reached to me via Tidelift. I've published version 0.5.1 with a fix together with the security advisory GHSA-qr28-fpjm-wq7f. |
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.
Malformed input with many distinct valid percent-encoded runs still causes quadratic work after the 0.5.0 scanner fix.
customDecodeURIComponentscans the full input once for each replacement-map key. The new regression uses 60,000 distinct runs and one invalid byte; the current release exceeds the child process's 3-second limit.Replace the map with one callback per original percent run. Keep UTF-16 BOM and truncated
%C2handling in the scanner, so they apply to the original input. This also corrects two malformed-input cases: decoded dollar patterns are inserted literally, and decoded percent signs cannot create a second escape to decode. Valid input and the existing CommonJS-independent API remain unchanged.Validation:
npm testpasses XO, 137 AVA tests, and TSD. The regression checks the full decoded value, bounds work in a child process, and covers repeated invalid bytes and long valid runs followed by a lone percent sign. Existing BOM, truncated%C2, Unicode, and type tests pass.