Title: [264154] releases/WebKitGTK/webkit-2.28
Revision
264154
Author
[email protected]
Date
2020-07-09 00:01:16 -0700 (Thu, 09 Jul 2020)

Log Message

Merge r258741 - Sanitize suggested download filename received from web process
https://bugs.webkit.org/show_bug.cgi?id=209300
<rdar://problem/59487723>

Patch by Alex Christensen <[email protected]> on 2020-03-19
Reviewed by Chris Dumez.

Source/WebKit:

* UIProcess/Downloads/DownloadProxy.cpp:
(WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):

LayoutTests:

* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt:
* fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html:

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog (264153 => 264154)


--- releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog	2020-07-09 07:01:10 UTC (rev 264153)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/ChangeLog	2020-07-09 07:01:16 UTC (rev 264154)
@@ -1,3 +1,14 @@
+2020-03-19  Alex Christensen  <[email protected]>
+
+        Sanitize suggested download filename received from web process
+        https://bugs.webkit.org/show_bug.cgi?id=209300
+        <rdar://problem/59487723>
+
+        Reviewed by Chris Dumez.
+
+        * fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt:
+        * fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html:
+
 2020-03-27  Simon Fraser  <[email protected]>
 
         Hovering over countries at https://covidinc.io/ shows bizarre rendering artifacts

Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt (264153 => 264154)


--- releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt	2020-07-09 07:01:10 UTC (rev 264153)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash-expected.txt	2020-07-09 07:01:16 UTC (rev 264154)
@@ -1,6 +1,6 @@
 Download started.
-Downloading URL with suggested filename "*\.png"
+Downloading URL with suggested filename "*.png"
 Download completed.
-The suggested filename above should be "*\.png" and the download should succeed.
+The suggested filename above should be "*.png" and the download should succeed.
 
 File backed blob URL

Modified: releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html (264153 => 264154)


--- releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html	2020-07-09 07:01:10 UTC (rev 264153)
+++ releases/WebKitGTK/webkit-2.28/LayoutTests/fast/dom/HTMLAnchorElement/anchor-file-blob-download-includes-backslash.html	2020-07-09 07:01:16 UTC (rev 264154)
@@ -12,7 +12,7 @@
 </script>
 </head>
 <body>
-<p>The suggested filename above should be "*\.png" and the download should succeed.</p>
+<p>The suggested filename above should be "*.png" and the download should succeed.</p>
 <a id="blob-url" download="*\">File backed blob URL</a>
 <script>
 function click(elmt)

Modified: releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog (264153 => 264154)


--- releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog	2020-07-09 07:01:10 UTC (rev 264153)
+++ releases/WebKitGTK/webkit-2.28/Source/WebKit/ChangeLog	2020-07-09 07:01:16 UTC (rev 264154)
@@ -1,3 +1,14 @@
+2020-03-19  Alex Christensen  <[email protected]>
+
+        Sanitize suggested download filename received from web process
+        https://bugs.webkit.org/show_bug.cgi?id=209300
+        <rdar://problem/59487723>
+
+        Reviewed by Chris Dumez.
+
+        * UIProcess/Downloads/DownloadProxy.cpp:
+        (WebKit::DownloadProxy::decideDestinationWithSuggestedFilenameAsync):
+
 2020-07-03  Michael Catanzaro  <[email protected]>
 
         [WPE][GTK] Bubblewrap sandbox should not attempt to bind empty paths

Modified: releases/WebKitGTK/webkit-2.28/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp (264153 => 264154)


--- releases/WebKitGTK/webkit-2.28/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp	2020-07-09 07:01:10 UTC (rev 264153)
+++ releases/WebKitGTK/webkit-2.28/Source/WebKit/UIProcess/Downloads/DownloadProxy.cpp	2020-07-09 07:01:16 UTC (rev 264154)
@@ -38,6 +38,7 @@
 #include "WebProcessPool.h"
 #include "WebProtectionSpace.h"
 #include <WebCore/MIMETypeRegistry.h>
+#include <WebCore/ResourceResponseBase.h>
 #include <wtf/FileSystem.h>
 #include <wtf/text/CString.h>
 #include <wtf/text/WTFString.h>
@@ -184,7 +185,7 @@
     if (!m_processPool)
         return;
     
-    m_processPool->downloadClient().decideDestinationWithSuggestedFilename(*this, suggestedFilename, [this, protectedThis = makeRef(*this), downloadID = downloadID] (AllowOverwrite allowOverwrite, String destination) {
+    m_processPool->downloadClient().decideDestinationWithSuggestedFilename(*this, ResourceResponseBase::sanitizeSuggestedFilename(suggestedFilename), [this, protectedThis = makeRef(*this), downloadID = downloadID] (AllowOverwrite allowOverwrite, String destination) {
         SandboxExtension::Handle sandboxExtensionHandle;
         if (!destination.isNull())
             SandboxExtension::createHandle(destination, SandboxExtension::Type::ReadWrite, sandboxExtensionHandle);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to