Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 0d3713dbb6d9bfab077d388293fca5beb3a05e29
https://github.com/WebKit/WebKit/commit/0d3713dbb6d9bfab077d388293fca5beb3a05e29
Author: Charlie Wolfe <[email protected]>
Date: 2026-06-15 (Mon, 15 Jun 2026)
Changed paths:
M Source/WebCore/platform/cocoa/DragDataCocoa.mm
M Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm
M Tools/TestWebKitAPI/Tests/WebKit/WKWebView/mac/DragAndDropTestsMac.mm
Log Message:
-----------
GetPasteboardPathnamesForType IPC allows types-only pasteboard access to read
file paths
https://bugs.webkit.org/show_bug.cgi?id=309384
rdar://170731738
Reviewed by Darin Adler.
During drag-over, WebPageProxy::dragEntered() grants types-only pasteboard
access.
getPasteboardPathnamesForType() was gated by canAccessPasteboardTypes(), which
returns true for
types-only access, allowing file paths and sandbox extensions to be returned to
the web process
before a drop occurs. Use canAccessPasteboardData() instead, which requires
types and data access,
which is granted only at drop time.
We also need to update DragData::containsPromise() to avoid calling
getPathnamesForType during
drag-over, since that would now be denied by the stricter access check.
m_promisedFileMIMETypes is
already populated by the UI process from NSFilePromiseReceiver items in
draggingEntered /
draggingUpdated and sent to the web process, so it is always available without
any pasteboard
access. This also relaxes the old files.size() == 1 restriction, which doesn’t
seem needed.
Test: Tools/TestWebKitAPI/Tests/mac/DragAndDropTestsMac.mm
* Source/WebCore/platform/cocoa/DragDataCocoa.mm:
(WebCore::DragData::containsPromise const):
* Source/WebKit/UIProcess/Cocoa/WebPasteboardProxyCocoa.mm:
(WebKit::WebPasteboardProxy::getPasteboardPathnamesForType):
* Tools/TestWebKitAPI/Tests/mac/DragAndDropTestsMac.mm:
(TEST(DragAndDropTests, PasteboardPathnamesRequireDataAccess)):
Originally-landed-as: 305413.424@rapid/safari-7624.2.5.110-branch
(25efcd0fa47a). rdar://176066984
Canonical link: https://commits.webkit.org/315268@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications