Changeset 86458 in webkit


Ignore:
Timestamp:
May 13, 2011 1:40:23 PM (13 years ago)
Author:
abarth@webkit.org
Message:

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

Reviewed by Eric Seidel.

indexedDB is visible inside iframe sandbox
https://bugs.webkit.org/show_bug.cgi?id=60785

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

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

Reviewed by Eric Seidel.

indexedDB is visible inside iframe sandbox
https://bugs.webkit.org/show_bug.cgi?id=60785

We're supposed to return a null indexedDB factory when inside an iframe
sandbox.

Test: http/tests/security/no-indexeddb-from-sandbox.html

  • page/DOMWindow.cpp: (WebCore::DOMWindow::webkitIndexedDB):
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r86457 r86458  
     12011-05-13  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        indexedDB is visible inside iframe sandbox
     6        https://bugs.webkit.org/show_bug.cgi?id=60785
     7
     8        * http/tests/security/no-indexeddb-from-sandbox-expected.txt: Added.
     9        * http/tests/security/no-indexeddb-from-sandbox.html: Added.
     10
    1112011-05-13  Mark Pilgrim  <pilgrim@chromium.org>
    212
  • trunk/Source/WebCore/ChangeLog

    r86455 r86458  
     12011-05-13  Adam Barth  <abarth@webkit.org>
     2
     3        Reviewed by Eric Seidel.
     4
     5        indexedDB is visible inside iframe sandbox
     6        https://bugs.webkit.org/show_bug.cgi?id=60785
     7
     8        We're supposed to return a null indexedDB factory when inside an iframe
     9        sandbox.
     10
     11        Test: http/tests/security/no-indexeddb-from-sandbox.html
     12
     13        * page/DOMWindow.cpp:
     14        (WebCore::DOMWindow::webkitIndexedDB):
     15
    1162011-05-13  Adam Roben  <aroben@apple.com>
    217
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r86325 r86458  
    730730IDBFactory* DOMWindow::webkitIndexedDB() const
    731731{
    732     if (m_idbFactory)
    733         return m_idbFactory.get();
    734 
    735732    Document* document = this->document();
    736733    if (!document)
    737734        return 0;
    738735
    739     // FIXME: See if access is allowed.
    740 
    741736    Page* page = document->page();
    742737    if (!page)
    743738        return 0;
    744739
    745     // FIXME: See if indexedDatabase access is allowed.
    746 
    747     m_idbFactory = IDBFactory::create(page->group().idbFactory());
     740    if (!document->securityOrigin()->canAccessDatabase())
     741        return 0;
     742
     743    if (!m_idbFactory)
     744        m_idbFactory = IDBFactory::create(page->group().idbFactory());
    748745    return m_idbFactory.get();
    749746}
Note: See TracChangeset for help on using the changeset viewer.