[PSON] Unable to submit a file in FormData cross-site
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 17:09:56 +0000 (17:09 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Nov 2018 17:09:56 +0000 (17:09 +0000)
commitba96b88e3ba983e196325cd94ee628fa99043ccb
treed2a0f5b97c49919806ba337d9771404c77930e4f
parent5128ee807a34a39ae031d95127f007a9128773d1
[PSON] Unable to submit a file in FormData cross-site
https://bugs.webkit.org/show_bug.cgi?id=191138

Reviewed by Alex Christensen.

Source/WebKit:

When PSON is enabled, we are unable to submit a file in FormData cross-site. Although we encode the
request body over IPC since r237639, we're missing the right sandbox extensions for its to work for
files.

Update FormDataReference encoder to pass along the necessary sandbox extensions for files in the
FormData, and have its decoder consume those extensions so that the recipient has access to those
files. Also update LoadParameters's IPC encoder / decoder to encoder an IPC::FormDataReference
(which encodes both FormData and sandbox extensions) instead of a FormData.

* Platform/IPC/FormDataReference.h:
(IPC::FormDataReference::encode const):
(IPC::FormDataReference::decode):
* Shared/LoadParameters.cpp:
(WebKit::LoadParameters::encode const):
(WebKit::LoadParameters::decode):

LayoutTests:

Add layout test coverage.

* http/tests/misc/form-submit-file-cross-site-expected.txt:
* http/tests/misc/form-submit-file-cross-site.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@237683 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/misc/form-submit-file-cross-site-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/misc/form-submit-file-cross-site.html [new file with mode: 0644]
LayoutTests/http/tests/misc/resources/check-test-file.php [new file with mode: 0644]
LayoutTests/platform/win/TestExpectations
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/FormDataReference.h
Source/WebKit/Shared/LoadParameters.cpp