[webkit-changes] [WebKit/WebKit] de7073: Crash under ContentSecurityPolicy::reportViolation()

Chris Dumez noreply at github.com
Wed Nov 8 08:36:21 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: de7073050171536e61b36d846c55b7366970f508
      https://github.com/WebKit/WebKit/commit/de7073050171536e61b36d846c55b7366970f508
  Author: Chris Dumez <cdumez at apple.com>
  Date:   2023-11-08 (Wed, 08 Nov 2023)

  Changed paths:
    M Source/WebCore/page/csp/ContentSecurityPolicy.cpp

  Log Message:
  -----------
  Crash under ContentSecurityPolicy::reportViolation()
https://bugs.webkit.org/show_bug.cgi?id=264372
rdar://117727308

Reviewed by David Kilzer.

The code was doing an early return in this case:
```
if (!usesReportTo && !is<Document>(m_scriptExecutionContext))
    return;
```
Then proceeding to downcast m_scriptExecutionContext to a Document.
This meant we would do a bad cast in the case where usesReportTo is
true.

* Source/WebCore/page/csp/ContentSecurityPolicy.cpp:
(WebCore::ContentSecurityPolicy::reportViolation const):

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




More information about the webkit-changes mailing list