RESOLVED FIXED 185567
X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
https://bugs.webkit.org/show_bug.cgi?id=185567
Summary X-Frame-Options: SAMEORIGIN needs to check all ancestor frames
Daniel Bates
Reported 2018-05-11 16:04:16 PDT
X-Frame-Options: SAMEORIGIN needs to check all ancestor frames.
Attachments
Patch and layout tests (19.01 KB, patch)
2018-05-11 16:26 PDT, Daniel Bates
bfulgham: review+
For EWS (18.71 KB, patch)
2018-05-11 20:06 PDT, Daniel Bates
no flags
Daniel Bates
Comment 1 2018-05-11 16:04:24 PDT
Daniel Bates
Comment 2 2018-05-11 16:04:48 PDT
Daniel Bates
Comment 3 2018-05-11 16:04:55 PDT
Daniel Bates
Comment 4 2018-05-11 16:25:42 PDT
Daniel Bates
Comment 5 2018-05-11 16:26:34 PDT
Created attachment 340230 [details] Patch and layout tests
EWS Watchlist
Comment 6 2018-05-11 16:28:39 PDT
Attachment 340230 [details] did not pass style-queue: ERROR: Source/WebKit/ChangeLog:11: Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: malicious, malicious, malicious [changelog/unwantedsecurityterms] [3] ERROR: Source/WebCore/ChangeLog:11: Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: malicious, malicious, malicious [changelog/unwantedsecurityterms] [3] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Brent Fulgham
Comment 7 2018-05-11 16:31:36 PDT
Comment on attachment 340230 [details] Patch and layout tests View in context: https://bugs.webkit.org/attachment.cgi?id=340230&action=review r=me, but I have a few minor complaints about the patch I hope you can resolve before landing. > Source/WebCore/loader/FrameLoader.cpp:3423 > + return true; Ha! It's funny it was every written as a break, considering that the loop wasn't doing anything meaningful! :-) > Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:419 > + if (!SecurityOrigin::create(url)->isSameSchemeHostPort(*m_parameters.sourceOrigin)) Do we need to create the SecurityOrigin twice? > Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:421 > + for (auto& origin : m_parameters.frameAncestorOrigins) { It's weird to have origin defined in two scopes, even though it apparently works. Could you name one the "sourceOrigin" or "topLevelOrigin" or something?
Daniel Bates
Comment 8 2018-05-11 18:39:18 PDT
Comment on attachment 340230 [details] Patch and layout tests View in context: https://bugs.webkit.org/attachment.cgi?id=340230&action=review >> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:419 >> + if (!SecurityOrigin::create(url)->isSameSchemeHostPort(*m_parameters.sourceOrigin)) > > Do we need to create the SecurityOrigin twice? Oops! Will fix before landing. >> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:421 >> + for (auto& origin : m_parameters.frameAncestorOrigins) { > > It's weird to have origin defined in two scopes, even though it apparently works. Could you name one the "sourceOrigin" or "topLevelOrigin" or something? Oops! I hope you do not mind that I rename the loop variable ancestorOrigin to resolve this ambiguity.
Brent Fulgham
Comment 9 2018-05-11 19:57:09 PDT
Comment on attachment 340230 [details] Patch and layout tests View in context: https://bugs.webkit.org/attachment.cgi?id=340230&action=review >>> Source/WebKit/NetworkProcess/NetworkResourceLoader.cpp:421 >>> + for (auto& origin : m_parameters.frameAncestorOrigins) { >> >> It's weird to have origin defined in two scopes, even though it apparently works. Could you name one the "sourceOrigin" or "topLevelOrigin" or something? > > Oops! I hope you do not mind that I rename the loop variable ancestorOrigin to resolve this ambiguity. That sounds like a great name!
Daniel Bates
Comment 10 2018-05-11 20:06:39 PDT
EWS Watchlist
Comment 11 2018-05-11 20:07:55 PDT
Attachment 340239 [details] did not pass style-queue: ERROR: Source/WebKit/ChangeLog:11: Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: malicious, malicious, malicious [changelog/unwantedsecurityterms] [3] ERROR: Source/WebCore/ChangeLog:11: Please consider whether the use of security-sensitive phrasing could help someone exploit WebKit: malicious, malicious, malicious [changelog/unwantedsecurityterms] [3] Total errors found: 2 in 16 files If any of these errors are false positives, please file a bug against check-webkit-style.
Daniel Bates
Comment 12 2018-05-11 21:11:18 PDT
Note You need to log in before you can comment on or make changes to this bug.