Changeset 285810 in webkit
- Timestamp:
- Nov 15, 2021, 10:36:44 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/urlencoded2.window-expected.txt (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/platform/network/FormDataBuilder.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r285808 r285810 1 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 3 Null bytes aren't percent-encoded on urlencoded over POST 4 https://bugs.webkit.org/show_bug.cgi?id=220780 5 6 Reviewed by Alex Christensen. 7 8 * web-platform-tests/html/semantics/forms/form-submission-0/urlencoded2.window-expected.txt: 9 1 10 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 11 -
trunk/LayoutTests/imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/urlencoded2.window-expected.txt
r280310 r285810 4 4 PASS application/x-www-form-urlencoded: Basic File test (normal form) 5 5 FAIL application/x-www-form-urlencoded: Basic File test (formdata event) assert_equals: expected "basic=file-test.txt" but got "" 6 FAIL application/x-www-form-urlencoded: 0x00 in name (normal form) assert_equals: expected "a%00b=c" but got "a\0b=c" 7 FAIL application/x-www-form-urlencoded: 0x00 in name (formdata event) assert_equals: expected "a%00b=c" but got "a\0b=c" 8 FAIL application/x-www-form-urlencoded: 0x00 in value (normal form) assert_equals: expected "a=b%00c" but got "a=b\0c" 9 FAIL application/x-www-form-urlencoded: 0x00 in value (formdata event) assert_equals: expected "a=b%00c" but got "a=b\0c" 10 FAIL application/x-www-form-urlencoded: 0x00 in filename (normal form) assert_equals: expected "a=b%00c" but got "a=b\0c" 6 PASS application/x-www-form-urlencoded: 0x00 in name (normal form) 7 PASS application/x-www-form-urlencoded: 0x00 in name (formdata event) 8 PASS application/x-www-form-urlencoded: 0x00 in value (normal form) 9 PASS application/x-www-form-urlencoded: 0x00 in value (formdata event) 10 PASS application/x-www-form-urlencoded: 0x00 in filename (normal form) 11 11 FAIL application/x-www-form-urlencoded: 0x00 in filename (formdata event) assert_equals: expected "a=b%00c" but got "" 12 12 PASS application/x-www-form-urlencoded: \n in name (normal form) -
trunk/Source/WebCore/ChangeLog
r285808 r285810 1 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 3 Null bytes aren't percent-encoded on urlencoded over POST 4 https://bugs.webkit.org/show_bug.cgi?id=220780 5 6 Reviewed by Alex Christensen. 7 8 This change fixes a bug where strchr was being used to match a character against a set 9 character list, without checking whether the character was NUL. This resulted in NUL bytes 10 being passed through in the urlencoded enctype over POST, rather than being percent-escaped. 11 12 Tests: imported/w3c/web-platform-tests/html/semantics/forms/form-submission-0/urlencoded2.window.html 13 14 * platform/network/FormDataBuilder.cpp: 15 (WebCore::FormDataBuilder::appendFormURLEncoded): 16 1 17 2021-11-15 Andreu Botella <andreu@andreubotella.com> 2 18 -
trunk/Source/WebCore/platform/network/FormDataBuilder.cpp
r278619 r285810 91 91 for (size_t i = 0; i < length; ++i) { 92 92 auto character = string[i]; 93 if (isASCIIAlphanumeric(character) || strchr(safeCharacters, character)) 93 if (isASCIIAlphanumeric(character) 94 || (character != '\0' && strchr(safeCharacters, character))) 94 95 append(buffer, character); 95 96 else if (character == ' ')
Note:
See TracChangeset
for help on using the changeset viewer.