Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5549b3663c5d3904eab780389cd14c58523d1dfa
      
https://github.com/WebKit/WebKit/commit/5549b3663c5d3904eab780389cd14c58523d1dfa
  Author: Per Arne Vollan <[email protected]>
  Date:   2026-08-25 (Tue, 25 Aug 2026)

  Changed paths:
    A 
LayoutTests/fast/html/trusted-types-set-attribute-iframe-removal-crash-expected.txt
    A 
LayoutTests/fast/html/trusted-types-set-attribute-iframe-removal-crash.html
    M Source/WebCore/dom/Attr.cpp

  Log Message:
  -----------
  Use-after-free of ScriptExecutionContext in trustedTypeCompliantString
https://bugs.webkit.org/show_bug.cgi?id=317320
rdar://177766868

Reviewed by Chris Dumez.

The method processValueWithDefaultPolicy can end up deleting the 
ScriptExecutionContext passed as parameter.
This patch fixes this by adding protection of ScriptExecutionContext.

Test: fast/html/trusted-types-set-attribute-iframe-removal-crash.html

* LayoutTests/fast/html/trusted-types-set-attribute-iframe-removal-crash.html: 
Added.
* 
LayoutTests/fast/html/trusted-types-set-attribute-iframe-removal-crash-expected.txt:
 Added.
* Source/WebCore/dom/Attr.cpp:
(WebCore::Attr::setValue):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setAttribute):
(WebCore::Element::setAttributeNode):
(WebCore::Element::setAttributeNodeNS):
(WebCore::Element::setAttributeNS):
* Source/WebCore/dom/TrustedType.cpp:
(WebCore::trustedTypeCompliantString):
(WebCore::requireTrustedTypesForPreNavigationCheckPasses):

Originally-landed-as: [email protected] (a26cf8dc190a). 
rdar://185368259
Canonical link: https://commits.webkit.org/319801@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to