[webkit-changes] [WebKit/WebKit] c9ac90: Limit maximum CSS rule nesting level

Antti Koivisto noreply at github.com
Mon Jun 19 13:20:38 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: c9ac90f8cbfa0ae54a296168fe0c517826ff6757
      https://github.com/WebKit/WebKit/commit/c9ac90f8cbfa0ae54a296168fe0c517826ff6757
  Author: Antti Koivisto <antti at apple.com>
  Date:   2023-06-19 (Mon, 19 Jun 2023)

  Changed paths:
    A LayoutTests/fast/media/mq-nesting-limit-expected.txt
    A LayoutTests/fast/media/mq-nesting-limit.html
    M Source/WebCore/css/parser/CSSParserImpl.cpp
    M Source/WebCore/css/parser/CSSParserImpl.h

  Log Message:
  -----------
  Limit maximum CSS rule nesting level
https://bugs.webkit.org/show_bug.cgi?id=258272
rdar://110312738

Reviewed by Alan Baradlay.

Deeply nested content (like accidentally unterminated @media rule lists) may end up blowing up the stack.

* LayoutTests/fast/media/mq-nesting-limit-expected.txt: Added.
* LayoutTests/fast/media/mq-nesting-limit.html: Added.
* Source/WebCore/css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeRegularRuleList):

Add a limit of 128 levels of nesting.

(WebCore::CSSParserImpl::consumeStyleRule):
* Source/WebCore/css/parser/CSSParserImpl.h:
(WebCore::CSSParserImpl::isNestedContext):

Canonical link: https://commits.webkit.org/265309@main




More information about the webkit-changes mailing list