Changeset 86462 in webkit


Ignore:
Timestamp:
May 13, 2011 2:44:11 PM (13 years ago)
Author:
abarth@webkit.org
Message:

2011-05-13 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

iframe sandbox doesn't properly block popups
https://bugs.webkit.org/show_bug.cgi?id=60784

Test that we block popup windows from inside sandbox.

  • http/tests/security/no-popup-from-sandbox-expected.txt: Added.
  • http/tests/security/no-popup-from-sandbox-top-expected.txt: Added.
  • http/tests/security/no-popup-from-sandbox-top.html: Added.
  • http/tests/security/no-popup-from-sandbox.html: Added.

2011-05-13 Adam Barth <abarth@webkit.org>

Reviewed by Eric Seidel.

iframe sandbox doesn't properly block popups
https://bugs.webkit.org/show_bug.cgi?id=60784

Previously, we weren't implementing this requirement from the spec:

"This flag also prevents content from creating new auxiliary browsing
contexts, e.g. using the target attribute or the window.open() method."

Tests: http/tests/security/no-popup-from-sandbox-top.html

http/tests/security/no-popup-from-sandbox.html

  • loader/PolicyChecker.cpp: (WebCore::PolicyChecker::checkNewWindowPolicy):
Location:
trunk
Files:
4 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86461 r86462  
     12011-05-13  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        iframe sandbox doesn't properly block popups
     6        https://bugs.webkit.org/show_bug.cgi?id=60784
     7
     8        Test that we block popup windows from inside sandbox.
     9
     10        * http/tests/security/no-popup-from-sandbox-expected.txt: Added.
     11        * http/tests/security/no-popup-from-sandbox-top-expected.txt: Added.
     12        * http/tests/security/no-popup-from-sandbox-top.html: Added.
     13        * http/tests/security/no-popup-from-sandbox.html: Added.
     14
    1152011-05-13  Ryosuke Niwa  <rniwa@webkit.org>
    216
  • trunk/Source/WebCore/ChangeLog

    r86461 r86462  
     12011-05-13  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        iframe sandbox doesn't properly block popups
     6        https://bugs.webkit.org/show_bug.cgi?id=60784
     7
     8        Previously, we weren't implementing this requirement from the spec:
     9
     10        "This flag also prevents content from creating new auxiliary browsing
     11        contexts, e.g. using the target attribute or the window.open() method."
     12
     13        Tests: http/tests/security/no-popup-from-sandbox-top.html
     14               http/tests/security/no-popup-from-sandbox.html
     15
     16        * loader/PolicyChecker.cpp:
     17        (WebCore::PolicyChecker::checkNewWindowPolicy):
     18
    1192011-05-13  Ryosuke Niwa  <rniwa@webkit.org>
    220
  • trunk/Source/WebCore/loader/PolicyChecker.cpp

    r80475 r86462  
    3838#include "FrameLoaderClient.h"
    3939#include "HTMLFormElement.h"
     40#include "SecurityOrigin.h"
    4041
    4142namespace WebCore {
     
    9394    const ResourceRequest& request, PassRefPtr<FormState> formState, const String& frameName, void* argument)
    9495{
     96    if (m_frame->document() && m_frame->document()->securityOrigin()->isSandboxed(SandboxNavigation))
     97        return continueAfterNavigationPolicy(PolicyIgnore);
     98
    9599    m_callback.set(request, formState, frameName, action, function, argument);
    96100    m_frame->loader()->client()->dispatchDecidePolicyForNewWindowAction(&PolicyChecker::continueAfterNewWindowPolicy,
Note: See TracChangeset for help on using the changeset viewer.