Changeset 273901 in webkit
- Timestamp:
- Mar 4, 2021 10:26:22 AM (17 months ago)
- Location:
- trunk
- Files:
-
- 4 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable-eval-expected.txt (added)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable-eval.html (added)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable-expected.txt (added)
-
LayoutTests/fast/frames/iframe-detached-window-still-writable.html (added)
-
LayoutTests/http/tests/dom/cross-origin-detached-window-properties-expected.txt (modified) (2 diffs)
-
LayoutTests/http/tests/dom/cross-origin-detached-window-properties.html (modified) (1 diff)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r273899 r273901 1 2021-03-04 Keith Miller <keith_miller@apple.com> 2 3 window proxy of detached iframe doesn't respect updates to global values 4 https://bugs.webkit.org/show_bug.cgi?id=206445 5 6 Reviewed by Chris Dumez. 7 8 * fast/frames/iframe-detached-window-still-writable-eval-expected.txt: Added. 9 * fast/frames/iframe-detached-window-still-writable-eval.html: Added. 10 * fast/frames/iframe-detached-window-still-writable-expected.txt: Added. 11 * fast/frames/iframe-detached-window-still-writable.html: Added. 12 * http/tests/dom/cross-origin-detached-window-properties-expected.txt: 13 * http/tests/dom/cross-origin-detached-window-properties.html: 14 1 15 2021-03-04 Jon Lee <jonlee@apple.com> 2 16 -
trunk/LayoutTests/http/tests/dom/cross-origin-detached-window-properties-expected.txt
r237209 r273901 33 33 PASS w.performance threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 34 34 PASS w.foo threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 35 PASS w.foo = 1 threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 36 PASS w[0] = 1 threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 35 37 PASS w.location.foo threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 36 38 … … 64 66 PASS w.performance threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 65 67 PASS w.foo threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 68 PASS w.foo = 1 threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 69 PASS w[0] = 1 threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 66 70 PASS w.location.foo threw exception SecurityError: Blocked a frame with origin "http://127.0.0.1:8000" from accessing a cross-origin frame. Protocols, domains, and ports must match.. 67 71 PASS successfullyParsed is true -
trunk/LayoutTests/http/tests/dom/cross-origin-detached-window-properties.html
r237209 r273901 49 49 50 50 shouldThrowErrorName("w.foo", "SecurityError"); 51 shouldThrowErrorName("w.foo = 1", "SecurityError"); 52 shouldThrowErrorName("w[0] = 1", "SecurityError"); 51 53 shouldThrowErrorName("w.location.foo", "SecurityError"); 52 54 } -
trunk/Source/WebCore/ChangeLog
r273897 r273901 1 2021-03-04 Keith Miller <keith_miller@apple.com> 2 3 window proxy of detached iframe doesn't respect updates to global values 4 https://bugs.webkit.org/show_bug.cgi?id=206445 5 6 Reviewed by Chris Dumez. 7 8 According to the html spec the frame should only be needing for 9 COOP access violation reporting, which we don't support. This 10 patch removes our old behavior of blocking stores to windows that 11 have been detached. 12 13 I also removed some stale caching code from 14 getOwnPropertySlotByIndex since it's only accessed once now. 15 16 * bindings/js/JSDOMWindowCustom.cpp: 17 (WebCore::JSDOMWindow::getOwnPropertySlotByIndex): 18 (WebCore::JSDOMWindow::doPutPropertySecurityCheck): 19 (WebCore::JSDOMWindow::put): 20 (WebCore::JSDOMWindow::putByIndex): 21 1 22 2021-03-04 Alex Christensen <achristensen@webkit.org> 2 23 -
trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp
r273138 r273901 299 299 slot.disableCaching(); 300 300 301 String errorMessage;302 Optional<bool> cachedIsCrossOriginAccess;303 auto isCrossOriginAccess = [&] {304 if (!cachedIsCrossOriginAccess)305 cachedIsCrossOriginAccess = !BindingSecurity::shouldAllowAccessToDOMWindow(*lexicalGlobalObject, window, errorMessage);306 return *cachedIsCrossOriginAccess;307 };308 309 301 // (1) First, indexed properties. 310 302 // These are also allowed cross-origin, so come before the access check. … … 315 307 316 308 // Hand off all cross-domain/frameless access to jsDOMWindowGetOwnPropertySlotRestrictedAccess. 317 if (isCrossOriginAccess()) 309 String errorMessage; 310 if (!BindingSecurity::shouldAllowAccessToDOMWindow(*lexicalGlobalObject, window, errorMessage)) 318 311 return jsDOMWindowGetOwnPropertySlotRestrictedAccess<DOMWindowType::Local>(thisObject, window, *lexicalGlobalObject, Identifier::from(vm, index), slot, errorMessage); 319 312 … … 328 321 329 322 auto* thisObject = jsCast<JSDOMWindow*>(cell); 330 if (!thisObject->wrapped().frame())331 return;332 323 333 324 String errorMessage; … … 347 338 348 339 auto* thisObject = jsCast<JSDOMWindow*>(cell); 349 if (!thisObject->wrapped().frame())350 return false;351 340 352 341 String errorMessage; … … 368 357 bool JSDOMWindow::putByIndex(JSCell* cell, JSGlobalObject* lexicalGlobalObject, unsigned index, JSValue value, bool shouldThrow) 369 358 { 359 VM& vm = lexicalGlobalObject->vm(); 370 360 auto* thisObject = jsCast<JSDOMWindow*>(cell); 371 if (!thisObject->wrapped().frame() || !BindingSecurity::shouldAllowAccessToDOMWindow(lexicalGlobalObject, thisObject->wrapped())) 361 auto scope = DECLARE_THROW_SCOPE(vm); 362 363 String errorMessage; 364 if (!BindingSecurity::shouldAllowAccessToDOMWindow(*lexicalGlobalObject, thisObject->wrapped(), errorMessage)) { 365 throwSecurityError(*lexicalGlobalObject, scope, errorMessage); 372 366 return false; 367 } 373 368 374 369 return Base::putByIndex(thisObject, lexicalGlobalObject, index, value, shouldThrow);
Note: See TracChangeset
for help on using the changeset viewer.