This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 26081 - Consider defining or mentioning the nonce attribute
Summary: Consider defining or mentioning the nonce attribute
Status: RESOLVED MOVED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: 2020 Q1
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-13 06:25 UTC by contributor
Modified: 2015-08-30 01:40 UTC (History)
7 users (show)

See Also:


Attachments

Description contributor 2014-06-13 06:25:39 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/semantics.html
Multipage: http://www.whatwg.org/C#the-style-element
Complete: http://www.whatwg.org/c#the-style-element
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Consider defining or mentioning the nonce attribute

Posted from: 77.57.114.66 by annevk@annevk.nl
User agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:33.0) Gecko/20100101 Firefox/33.0
Comment 1 Anne 2014-06-13 06:26:46 UTC
It's in https://w3c.github.io/webappsec/specs/content-security-policy/#script-src-the-nonce-attribute on <style> and <script>.

Having HTML attributes defined in HTML seems better. We should at least keep a complete list somewhere outside of browsers.
Comment 2 Ian 'Hixie' Hickson 2014-06-13 18:31:32 UTC
what are the authoring and UA conformance requirements?
Comment 3 Anne 2014-07-31 07:38:19 UTC
I'm not sure. Just trying to keep the list of HTML attributes we support in a single place. Mike or Daniel should know.
Comment 4 Daniel Veditz 2014-07-31 15:04:01 UTC
Could it be defined by external reference to the CSP spec? I agree it would help authors to have a complete list of attributes in one place but I don't think we want duplicate definitions.
Comment 5 Ian 'Hixie' Hickson 2014-07-31 15:29:57 UTC
The definition should only be in one place, certainly.
Comment 6 Mike West 2014-07-31 15:31:33 UTC
It's currently defined at http://www.w3.org/TR/CSP2/#script-src-the-nonce-attribute

What should we add to that to make the requirements clear?
Comment 7 Ian 'Hixie' Hickson 2014-07-31 23:20:03 UTC
Pointing to that is probably sufficient, though maybe we should move the IDL stuff from CSP to HTML entirely, since that's not really what CSP is about anyway.
Comment 8 Ian 'Hixie' Hickson 2014-09-08 22:58:43 UTC
Looking at this more closely, I realise that this integrates pretty closely with the <script> processing algorithm. It seems like the right solution here would be to put the logic in the HTML spec, and have the CSP spec provide a hook by which the nonce and hash values can be obtained for checking. Is that a plausible plan?
Comment 9 Mike West 2014-09-09 09:13:56 UTC
(In reply to Ian 'Hixie' Hickson from comment #8)
> Looking at this more closely, I realise that this integrates pretty closely
> with the <script> processing algorithm. It seems like the right solution
> here would be to put the logic in the HTML spec, and have the CSP spec
> provide a hook by which the nonce and hash values can be obtained for
> checking. Is that a plausible plan?

Sure. Happy to make that change in the CSP spec.
Comment 10 Mike West 2014-09-09 09:14:44 UTC
Sorry, hit submit too quickly: what would you like such a hook to provide? Just a sequence of string values you could compare against?
Comment 11 Ian 'Hixie' Hickson 2014-09-09 15:55:14 UTC
Yeah, probably. There's no attempt to map specific elements to specific strings right? There's just a list of nonces and a list of hashes?
Comment 12 Mike West 2014-09-10 10:45:51 UTC
(In reply to Ian 'Hixie' Hickson from comment #11)
> Yeah, probably. There's no attempt to map specific elements to specific
> strings right? There's just a list of nonces and a list of hashes?

I think you'll need the following:

* Valid nonces for script
* Valid nonces for style
* Pairs of (algorithm, hash) for script
* Pairs of (algorithm, hash) for style

See https://w3c.github.io/webappsec/specs/content-security-policy/#source-list-valid-nonces and https://w3c.github.io/webappsec/specs/content-security-policy/#source-list-valid-hashes for the currently defined algorithms for nonces and hashes respectively.
Comment 13 Ian 'Hixie' Hickson 2014-10-10 18:12:56 UTC
I think for now I'm going to punt on this. The way it's specified works, this would just be editorial.
Comment 14 Ian 'Hixie' Hickson 2014-11-07 21:43:17 UTC
Let me know if there's an important reason to prioritise this earlier.
Comment 15 Michael[tm] Smith 2015-08-30 01:40:30 UTC
Moved to https://github.com/whatwg/html/pull/49