mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: <iframe src> same-origin check should be based on host document
We were basing the src attribute's cross-origin check on whatever was currently loaded in the iframe, instead of the surrounding document. Fixes #4236.
This commit is contained in:
Notes:
sideshowbarker
2024-07-19 00:59:18 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/6496895b16a
@@ -79,8 +79,8 @@ void HTMLIFrameElement::load_src(const String& value)
|
||||
dbg() << "iframe failed to load URL: Invalid URL: " << value;
|
||||
return;
|
||||
}
|
||||
if (url.protocol() == "file" && content_origin().protocol() != "file") {
|
||||
dbg() << "iframe failed to load URL: Security violation: " << document().url() << " may not load " << value;
|
||||
if (url.protocol() == "file" && document().origin().protocol() != "file") {
|
||||
dbg() << "iframe failed to load URL: Security violation: " << document().url() << " may not load " << url;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user