Conversation
Thanks to sgbhat2 for fuzztesting the library and finding out.
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.
Identify the Bug
Unescaping URLs fails causing a full abort of the server. This happens when URLs have incomplete patterns resembling escape sequences as it assumes the sequence to be complete.
Description of the Change
Make the library immune from such error by checking the length of the string in input when unescaping.
Alternate Designs
We could flip the escape/unescape logic (thus only running this once at endpoint registration). This alternative design would have performance benefits but it is out of the purpose of this change and will require more work. Given the urgency, the current solution is the best option (as it doesn't degrade performance and fixes the issue).
Possible Drawbacks
None
Verification Process
Unit tests + travis runs.
Release Notes
Fixed heap buffer overflow when unescaping URLs containing partial escape sequences.