ladybird/Tests/LibWeb
sideshowbarker 9f7a328d9b LibWeb: Reject canvas toDataURL()/toBlob() when not origin-clean
Problem: Drawing a cross-origin image onto a 2D canvas clears its
origin-clean flag, but toDataURL() and toBlob() ignored that flag and
serialized the bitmap regardless. So, a page could read back the
cross-origin pixels it shouldn't (per spec) be allowed to access.

Cause: The origin-clean checks in to_data_url() and to_blob() were left
as FIXMEs. Only getImageData() enforced the flag.

Fix: Throw a SecurityError exception from both serialization entry
points when the canvas isn't origin-clean — matching getImageData() and
the spec. The same check also implements the previously-stubbed
origin-clean step in the WebDriver canvas-encoding algorithm.

Fixes: https://github.com/LadybirdBrowser/ladybird/issues/10009
2026-06-18 10:52:42 +02:00
..
Assets LibWeb: Verify whitespace font has the glyph in font_for_space() 2026-04-22 20:27:41 +02:00
Crash LibWeb: Keep child navigable history updates coherent 2026-06-15 01:15:09 +02:00
CSSTokenizer LibWeb: Clamp CSS numeric token values to float range 2026-04-22 14:24:12 +01:00
Fixtures Tests: Configure WPT server substitutions for local hosts 2026-06-11 17:01:48 +02:00
Layout LibWeb: Do not dump number of children for StackingContexts 2026-06-18 10:50:08 +02:00
Ref LibWeb: Inline image scaling mode computation 2026-06-18 10:44:25 +02:00
Screenshot LibWeb: Transfer animation ownership to AnimatedBitmapDecodedImageData 2026-06-18 10:44:25 +02:00
test-web Tests: Support WPT reftests with multiple references 2026-06-14 22:12:00 +02:00
Text LibWeb: Reject canvas toDataURL()/toBlob() when not origin-clean 2026-06-18 10:52:42 +02:00
Tokenizer LibWeb: Add HTML tokenizer dump tests 2026-05-15 21:01:40 +02:00
add_libweb_test.py LibWeb: Compare Screenshot tests directly against expected PNGs 2026-02-24 09:55:14 +01:00
CMakeLists.txt LibWeb: Preserve compatible visual context tree versions 2026-06-18 00:12:42 +02:00
css-tokenizer.cpp LibWeb: Honor requested CSS tokenizer encoding 2026-05-18 14:08:22 +02:00
test-css-tokenizer.py LibWeb/CSS: Port the CSS Tokenizer to Rust 2026-05-03 09:49:00 +02:00
TestAccumulatedVisualContext.cpp LibWeb: Skip repaint for visual context-only style changes 2026-06-18 00:12:42 +02:00
TestConfig.ini LibWeb: Reject canvas toDataURL()/toBlob() when not origin-clean 2026-06-18 10:52:42 +02:00
TestContentBlocker.cpp LibWeb: Use adblock-rust in ContentBlocker 2026-05-24 08:16:46 +02:00
TestControlMessageQueue.cpp LibWeb/WebAudio: Add stable IDs to AudioNodes 2026-01-23 15:03:43 +01:00
TestCSSIDSpeed.cpp
TestCSSInheritedProperty.cpp
TestCSSPixels.cpp LibWeb/CSS: Retain length precision in PercentageOr<T> 2026-06-18 09:59:41 +02:00
TestCSSStyleSheetInvalidation.cpp LibWeb: Split shadow stylesheet host-side invalidation reach 2026-05-05 18:36:34 +02:00
TestCSSSyntaxParser.cpp
TestCSSTokenizer.cpp LibWeb: Honor requested CSS tokenizer encoding 2026-05-18 14:08:22 +02:00
TestCSSTokenStream.cpp
TestFetchResponse.cpp LibWeb: Preserve JS bytecode in memory cache 2026-06-06 09:15:09 +02:00
TestFetchURL.cpp
TestHTMLTokenizer.cpp LibWeb: Replace the HTML tokenizer with Rust 2026-05-15 21:01:40 +02:00
TestMicrosyntax.cpp
TestMimeSniff.cpp
TestNumbers.cpp
TestPage.cpp LibWeb+WebContent+WebWorker: Drop display list player type selection 2026-06-18 10:25:44 +02:00
TestRefCountedTreeNode.cpp LibWeb: Add RefCountedTreeNode 2026-05-07 15:03:44 +02:00
TestSecureContexts.cpp LibWeb/SecureContexts: Correct the 127.0.0.0/8 trustworthiness check 2026-05-31 21:56:18 +02:00
TestSessionHistoryEntry.cpp LibWeb: Let newer navigations win history races 2026-06-16 00:00:38 +02:00
TestSourceHighlighter.cpp LibSyntax+LibJS+LibWebView: Port the syntax highlighter to UTF-8 2026-06-06 18:42:18 +02:00
TestStrings.cpp
tokenizer-test.html