[wpt-sync] Sync PR 65038 - WebKit export of https://bugs.webkit.org/show_bug.cgi?id=330861
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox163 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 65038 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/65038
Details from upstream follow.
Ahmad Saleem <ahmad.saleem792+github@gmail.com> wrote:
WebKit export of https://bugs.webkit.org/show_bug.cgi?id=330861
WebKit export from bug: Crash in DataTransfer:<!---->:<!---->updateFileList(<!---->)<!----> because the dragstart DataTransfer stays writable after dispatch
<pre>
Crash in DataTransfer::updateFileList() because the dragstart DataTransfer stays writable after dispatchEventHandler::handleDrag() dispatches dragstart with a separate
read/write DataTransfer, then calls moveDragState() to move its state
into dragState().dataTransfer. Only dragState().dataTransfer was then
made invalid for security. The DataTransfer that script can see stayed
in read/write mode for as long as script kept a reference to it.moveDragState() also moves m_fileList away from that object. If script
used dataTransfer.items during dragstart and later, for example in a
setTimeout, called items.add(file) and then items.remove(0), add()
succeeded, didAddFileToItemList() returned early because m_fileList was
null, and remove() called updateFileList(), which dereferenced the null
m_fileList.Per the HTML spec, once a DND event has been dispatched the DataTransfer
is no longer associated with the drag data store, so its item list is in
disabled mode: add() must return null and remove() must throw an
InvalidStateError.Fix this by making the dragstart DataTransfer invalid for security
before moving its state. Also make updateFileList() return early when
m_fileList is null, matching didAddFileToItemList().WebKit-Bug: <a href="https://bugs.webkit.org/show_bug.cgi?id=330861">https://bugs.webkit.org/show_bug.cgi?id=330861</a>
WebKit-Canonical-Link: <a href="https://commits.webkit.org/326392@main">https://commits.webkit.org/326392@main</a>
</pre>
| Assignee | ||
Updated•11 days ago
|
| Assignee | ||
Comment 1•11 days ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=122434
| Assignee | ||
Comment 2•10 days ago
|
||
CI Results
Ran 0 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 2 tests and 3 subtests
Status Summary
Firefox
OK : 2
PASS : 4
Chrome
OK : 2
PASS : 4
Safari
OK : 1
PASS : 3
ERROR: 1
Links
Comment 4•8 days ago
|
||
| bugherder | ||
Description
•