WebKit should percent encode single quotes in query strings
authorbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 16:02:10 +0000 (16:02 +0000)
committerbfulgham@apple.com <bfulgham@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Apr 2017 16:02:10 +0000 (16:02 +0000)
commit448c538274ccf372a678ef7033d182130d75c395
treebd4305f90f810bafcdfb57f55ecb3678026731af
parent8620a0fafd464f99f685f2bcf92c32414e949b84
WebKit should percent encode single quotes in query strings
https://bugs.webkit.org/show_bug.cgi?id=170561
<rdar://problem/7415154>

Reviewed by Alex Christensen.

Source/WebCore:

Modify the characterClassTable to instruct the URLParser to convert
the single-quote character ' to %27 in URL query strings.

Tests: URLParserTest in TestWebKitAPI.
    fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame.html
    fast/frames/xss-auditor-handles-file-urls.html
    http/tests/security/xssAuditor

* platform/URLParser.cpp:

Tools:

Add a test case for single-quote in the URL query string.

* TestWebKitAPI/Tests/WebCore/URLParser.cpp:

LayoutTests:

Rebaseline tests after change.

* fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt:
* fast/frames/xss-auditor-handles-file-urls-expected.txt:
* http/tests/security/xssAuditor/base-href-control-char-expected.txt:
* http/tests/security/xssAuditor/base-href-expected.txt:
* http/tests/security/xssAuditor/base-href-null-char-expected.txt:
* http/tests/security/xssAuditor/base-href-scheme-relative-expected.txt:
* http/tests/security/xssAuditor/embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/embed-tag-expected.txt:
* http/tests/security/xssAuditor/embed-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/form-action-expected.txt:
* http/tests/security/xssAuditor/formaction-on-button-expected.txt:
* http/tests/security/xssAuditor/formaction-on-input-expected.txt:
* http/tests/security/xssAuditor/frameset-injection-expected.txt:
* http/tests/security/xssAuditor/full-block-base-href-expected.txt:
* http/tests/security/xssAuditor/full-block-link-onclick-expected.txt:
* http/tests/security/xssAuditor/full-block-object-tag-expected.txt:
* http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/iframe-injection-expected.txt:
* http/tests/security/xssAuditor/iframe-javascript-url-more-encoding-expected.txt:
* http/tests/security/xssAuditor/img-onerror-non-ASCII-char-default-encoding-expected.txt:
* http/tests/security/xssAuditor/img-onerror-non-ASCII-char-expected.txt:
* http/tests/security/xssAuditor/link-onclick-ampersand-expected.txt:
* http/tests/security/xssAuditor/link-onclick-control-char-expected.txt:
* http/tests/security/xssAuditor/link-onclick-entities-expected.txt:
* http/tests/security/xssAuditor/link-onclick-expected.txt:
* http/tests/security/xssAuditor/link-onclick-null-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-expected.txt:
* http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt:
* http/tests/security/xssAuditor/object-tag-expected.txt:
* http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt:
* http/tests/security/xssAuditor/script-tag-expression-follows-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-16bit-unicode4-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-16bit-unicode5-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-comma-01-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-control-char-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-entities-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-null-char-expected.txt:
* http/tests/security/xssAuditor/script-tag-with-source-same-host-with-query-expected.txt:
* http/tests/security/xssAuditor/svg-animate-expected.txt:
* http/tests/security/xssAuditor/svg-script-tag-expected.txt:
* http/tests/security/xssAuditor/xss-filter-bypass-big5-expected.txt:
* http/tests/security/xssAuditor/xss-filter-bypass-sjis-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@215096 268f45cc-cd09-0410-ab3c-d52691b4dbfc
50 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/events/popup-blocked-from-unique-frame-via-window-open-named-sibling-frame-expected.txt
LayoutTests/fast/frames/xss-auditor-handles-file-urls-expected.txt
LayoutTests/http/tests/security/xssAuditor/base-href-control-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/base-href-expected.txt
LayoutTests/http/tests/security/xssAuditor/base-href-null-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/base-href-scheme-relative-expected.txt
LayoutTests/http/tests/security/xssAuditor/embed-tag-control-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/embed-tag-expected.txt
LayoutTests/http/tests/security/xssAuditor/embed-tag-javascript-url-expected.txt
LayoutTests/http/tests/security/xssAuditor/embed-tag-null-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/form-action-expected.txt
LayoutTests/http/tests/security/xssAuditor/formaction-on-button-expected.txt
LayoutTests/http/tests/security/xssAuditor/formaction-on-input-expected.txt
LayoutTests/http/tests/security/xssAuditor/frameset-injection-expected.txt
LayoutTests/http/tests/security/xssAuditor/full-block-base-href-expected.txt
LayoutTests/http/tests/security/xssAuditor/full-block-link-onclick-expected.txt
LayoutTests/http/tests/security/xssAuditor/full-block-object-tag-expected.txt
LayoutTests/http/tests/security/xssAuditor/full-block-script-tag-with-source-expected.txt
LayoutTests/http/tests/security/xssAuditor/iframe-injection-expected.txt
LayoutTests/http/tests/security/xssAuditor/iframe-javascript-url-more-encoding-expected.txt
LayoutTests/http/tests/security/xssAuditor/img-onerror-non-ASCII-char-default-encoding-expected.txt
LayoutTests/http/tests/security/xssAuditor/img-onerror-non-ASCII-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/link-onclick-ampersand-expected.txt
LayoutTests/http/tests/security/xssAuditor/link-onclick-control-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/link-onclick-entities-expected.txt
LayoutTests/http/tests/security/xssAuditor/link-onclick-expected.txt
LayoutTests/http/tests/security/xssAuditor/link-onclick-null-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/object-embed-tag-control-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/object-embed-tag-expected.txt
LayoutTests/http/tests/security/xssAuditor/object-embed-tag-null-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/object-tag-expected.txt
LayoutTests/http/tests/security/xssAuditor/object-tag-javascript-url-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-expression-follows-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-16bit-unicode4-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-16bit-unicode5-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-comma-01-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-source-control-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-source-entities-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-source-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-source-null-char-expected.txt
LayoutTests/http/tests/security/xssAuditor/script-tag-with-source-same-host-with-query-expected.txt
LayoutTests/http/tests/security/xssAuditor/svg-animate-expected.txt
LayoutTests/http/tests/security/xssAuditor/svg-script-tag-expected.txt
LayoutTests/http/tests/security/xssAuditor/xss-filter-bypass-big5-expected.txt
LayoutTests/http/tests/security/xssAuditor/xss-filter-bypass-sjis-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/platform/URLParser.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/URLParser.cpp