Ignore invalid RFC 2231 extended value so it cannot erase a valid filename (1.x)#480
Open
alhudz wants to merge 1 commit into
Open
Ignore invalid RFC 2231 extended value so it cannot erase a valid filename (1.x)#480alhudz wants to merge 1 commit into
alhudz wants to merge 1 commit into
Conversation
…ename Port of apache#479 to 1.x.
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.
Port of #479 to the
1.xbranch, as requested there. The 1.xParameterParser.parsehas the same pattern: anIllegalArgumentExceptionfrom the RFC 2231 decode setsparamValue = nulland the parameter is still stored, so a malformedfilename*clobbers a validfilenameafterstripDelimiter.Repro:
parse("form-data; name=\"file\"; filename=\"safe.txt\"; filename*=UTF-8''bad%2", new char[]{',',';'}). Expected:filenamestayssafe.txt. Actual on unpatched 1.x:filenameisnull(the new test fails withexpected: <safe.txt> but was: <null>).Same fix as #479, adapted to 1.x (no
var): flag the invalid decode and skip storing that parameter. Includes the same regression test; full 1.x suite passes (87 tests) and checkstyle is clean.