[Webkit-unassigned] [Bug 160960] WebKit blocks 'unsafe-inline' event handler upon execution, not upon setting

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Aug 18 11:31:59 PDT 2016


https://bugs.webkit.org/show_bug.cgi?id=160960

--- Comment #1 from Daniel Bates <dbates at webkit.org> ---
(In reply to comment #0)
> >  When an event handler content attribute is set, execute the following steps:
> >  
> >    If the Should element's inline behavior be blocked by Content Security Policy? algorithm returns "Blocked" when executed upon the attribute's element, "script attribute", and the attribute's value, then abort these steps. [CSP]
> 

This quote is from section Events handlers of the HTML5 spec. <https://html.spec.whatwg.org/multipage/webappapis.html#event-handlers> (18 August 2016).

This wording is consistent with section Should element’s inline type behavior be blocked by Content Security Policy? of the CSP Level 3 specification (Editor's Draft, 18 August 2016). Though this section of the CSP spec. and the quote from the HTML5 spec. seem inconsistent with the wording used in (5) of section Integration with HTML of the CSP Level 3 specification:

"§4.2.3 Should element’s inline type behavior be blocked by Content Security Policy? is called during handling of inline event handlers (like onclick) and inline style attributes in order to determine whether or not they ought to be allowed to execute/render."

The phrase "allowed to execute" could be read as CSP blocks an inline event handler when it is invoked. I suspect this wording is an oversight. Regardless, the wording in the HTML5 spec. and in CSP Level 3 represents a change of behavior from CSP Level 2. Currently WebKit conforms to the inline event handler blocking and reporting behavior as defined in section script-src of the CSP Level 2 spec.:

[[
If 'unsafe-inline' is not in the list of allowed script sources, or if at least one nonce-source or hash-source is present in the list of allowed script sources:
...
Whenever the user agent would execute an inline script from an inline event handler, instead the user agent MUST NOT execute script, and MUST report a violation.
]]
<https://w3c.github.io/webappsec-csp/2/#directive-script-src> (Editor's Draft, 25 April 2016)

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20160818/609eb334/attachment-0001.html>


More information about the webkit-unassigned mailing list