Changeset 258744 in webkit


Ignore:
Timestamp:
Mar 19, 2020 4:48:18 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

ScriptDisallowedScope should disable isEventAllowedInMainThread and isEventDispatchAllowedInSubtree asserts in WebKit1
https://bugs.webkit.org/show_bug.cgi?id=209165

Patch by Sunny He <sunny_he@apple.com> on 2020-03-19
Reviewed by Ryosuke Niwa.

Under very intricate sequences of event dispatch in WebKit1, it is
possible for security asserts to be triggered even if there is no
underlying security issue soley due to the design patterns of
WebKit1.

No new tests since the conditions for reproduction are very delicate
and difficult to reliably capture in a test case.

  • dom/ScriptDisallowedScope.h:

(WebCore::ScriptDisallowedScope::isEventAllowedInMainThread):
(WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r258737 r258744  
     12020-03-19  Sunny He  <sunny_he@apple.com>
     2
     3        ScriptDisallowedScope should disable isEventAllowedInMainThread and isEventDispatchAllowedInSubtree asserts in WebKit1
     4        https://bugs.webkit.org/show_bug.cgi?id=209165
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        Under very intricate sequences of event dispatch in WebKit1, it is
     9        possible for security asserts to be triggered even if there is no
     10        underlying security issue soley due to the design patterns of
     11        WebKit1.
     12
     13        No new tests since the conditions for reproduction are very delicate
     14        and difficult to reliably capture in a test case.
     15
     16        * dom/ScriptDisallowedScope.h:
     17        (WebCore::ScriptDisallowedScope::isEventAllowedInMainThread):
     18        (WebCore::ScriptDisallowedScope::InMainThread::isEventDispatchAllowedInSubtree):
     19
    1202020-03-19  Tim Horton  <timothy_horton@apple.com>
    221
  • trunk/Source/WebCore/dom/ScriptDisallowedScope.h

    r254087 r258744  
    2525
    2626#include "ContainerNode.h"
     27#include "RuntimeApplicationChecks.h"
    2728#include <wtf/MainThread.h>
    2829
     
    6364    static bool isEventAllowedInMainThread()
    6465    {
    65         return !isMainThread() || !s_count;
     66        return !isInWebProcess() || !isMainThread() || !s_count;
    6667    }
    6768
     
    8687        {
    8788#if ASSERT_ENABLED || ENABLE(SECURITY_ASSERTIONS)
    88             return isScriptAllowed() || EventAllowedScope::isAllowedNode(node);
     89            return !isInWebProcess() || isScriptAllowed() || EventAllowedScope::isAllowedNode(node);
    8990#else
    9091            UNUSED_PARAM(node);
Note: See TracChangeset for help on using the changeset viewer.