Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upProvide hooks for Content Security Policy (CSP) #450
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Mar 3, 2016
Member
@Ms2ger This is not the place for these discussions. Please email es-discuss.
|
@Ms2ger This is not the place for these discussions. Please email es-discuss. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
This is 100% the place for this "discussion". |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
I will work on a pull request for this today. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
annevk
Mar 3, 2016
Contributor
Some historical context: https://bugs.ecmascript.org/show_bug.cgi?id=2494.
|
Some historical context: https://bugs.ecmascript.org/show_bug.cgi?id=2494. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
michaelficarra
Mar 3, 2016
Member
@domenic As I understand it, this repo is for concrete proposals and bug fixes. Not an open-ended discussion.
|
@domenic As I understand it, this repo is for concrete proposals and bug fixes. Not an open-ended discussion. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
Yes, this is a concrete bugfix to match implementations. No discussion is needed.
|
Yes, this is a concrete bugfix to match implementations. No discussion is needed. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erights
Mar 3, 2016
Yes, this is a concrete bugfix to match implementations. No discussion is needed.
WHAT? Such notions have not previously been part of EcmaScript. I understand why they probably should be, but this is absolutely a substantive discussion, not a bug fix.
erights
commented
Mar 3, 2016
WHAT? Such notions have not previously been part of EcmaScript. I understand why they probably should be, but this is absolutely a substantive discussion, not a bug fix. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
This is like the other host hooks. It's already implemented everywhere, too. It has no normative consequences, only layering ones. There's no need for discussion; the proper place for discussion if you wanted to change the behavior was in the webappsec working group.
|
This is like the other host hooks. It's already implemented everywhere, too. It has no normative consequences, only layering ones. There's no need for discussion; the proper place for discussion if you wanted to change the behavior was in the webappsec working group. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
This was also resolved to be a trivial change in https://bugs.ecmascript.org/show_bug.cgi?id=2494 and desired for inclusion in the spec. Allen says there are enough hooks already but they aren't very explicit, if they exist. (I guess he is referring to hooking into the creation of new execution contexts.)
|
This was also resolved to be a trivial change in https://bugs.ecmascript.org/show_bug.cgi?id=2494 and desired for inclusion in the spec. Allen says there are enough hooks already but they aren't very explicit, if they exist. (I guess he is referring to hooking into the creation of new execution contexts.) |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
added a commit
to domenic/ecma262
that referenced
this issue
Mar 3, 2016
domenic
referenced this issue
Mar 3, 2016
Closed
Layering: add hook to allow implementations to block string compilation #451
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zenparsing
Mar 3, 2016
Contributor
@Ms2ger Out of respect to those readers (like me) who don't have the necessary context, please take the time to write a full description with appropriate links when creating an issue like this.
|
@Ms2ger Out of respect to those readers (like me) who don't have the necessary context, please take the time to write a full description with appropriate links when creating an issue like this. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
Ms2ger
Mar 3, 2016
Added some more background to the summary. I may have mistakenly assumed that a search engine of your choice would have been able to find sufficient context.
Ms2ger
commented
Mar 3, 2016
|
Added some more background to the summary. I may have mistakenly assumed that a search engine of your choice would have been able to find sufficient context. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zenparsing
Mar 3, 2016
Contributor
@Ms2ger Awesome, but I'm curious what's with all the terseness and snark?
|
@Ms2ger Awesome, but I'm curious what's with all the terseness and snark? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
It probably has something to do with this contributor's first welcome to the tc39 github repo being told to go away in a terse and snarky way.
|
It probably has something to do with this contributor's first welcome to the tc39 github repo being told to go away in a terse and snarky way. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zenparsing
Mar 3, 2016
Contributor
Ah, that would do it. Well, chalk it up to a misunderstanding, and good to have you here, @Ms2ger !
|
Ah, that would do it. Well, chalk it up to a misunderstanding, and good to have you here, @Ms2ger ! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erights
commented
Mar 3, 2016
|
Yes @Ms2ger , welcome! |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
Mar 3, 2016
Member
This was also resolved to be a trivial change in (https://bugs.ecmascript.org/show_bug.cgi?id=2494) and desired for inclusion in the spec. Allen says there are enough hooks already but they aren't very explicit, if they exist. (I guess he is referring to hooking into the creation of new execution contexts.)
The hook is step 11 of [InitializeHostDefineRealm()]](http://tc39.github.io/ecma262/#sec-initializehostdefinedrealm)
11. Create any implementation defined global object properties on globalObj.
Arguably this might be better worded as:
11. Define any implementation defined global object properties on globalObj.
to cover the cases of eval and function which have already been created prior to step 11.
In addition, the following paragraph should be added to Clause 16
An implementation may extend the behaviour of eval, the Function constructor, and %GeneratorFunction% that restricts where they may be used or the ECMAScript source code that they will accept.
All the other details should be left to the CSPspec.
The hook is step 11 of [InitializeHostDefineRealm()]](http://tc39.github.io/ecma262/#sec-initializehostdefinedrealm)
Arguably this might be better worded as:
to cover the cases of In addition, the following paragraph should be added to Clause 16
All the other details should be left to the CSPspec. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
Thanks Allen. I'd rather add specific restricted and explicit hooks as in #451 (which e.g. clarifies which steps in which algorithms, including direct eval, are affected) rather than use those kind of blanket permissions.
|
Thanks Allen. I'd rather add specific restricted and explicit hooks as in #451 (which e.g. clarifies which steps in which algorithms, including direct eval, are affected) rather than use those kind of blanket permissions. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
allenwb
Mar 3, 2016
Member
I agree that a hook for direct eval is needed. I think the right place to put it is in PerformEval rather than at the call sites to PerformEval.
I don't think need a "hook" operation like HostEnsureCompileStrings is need. A prose line in PerformEval is more readable and can be as specific as you want to make it.
|
I agree that a hook for direct eval is needed. I think the right place to put it is in PerformEval rather than at the call sites to PerformEval. I don't think need a "hook" operation like HostEnsureCompileStrings is need. A prose line in PerformEval is more readable and can be as specific as you want to make it. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Mar 3, 2016
Member
I think a hook operation is more precise and clearer for host environments (both implementations and specs). It certainly maps better to the existing open source engines. We can let the editor decide.
PerformEval is not sufficient since we need both the calleeRealm and the callerRealm to match web reality.
|
I think a hook operation is more precise and clearer for host environments (both implementations and specs). It certainly maps better to the existing open source engines. We can let the editor decide. PerformEval is not sufficient since we need both the calleeRealm and the callerRealm to match web reality. |
Ms2ger commentedMar 3, 2016
In particular, CSP wants to do something to
eval()andnew Function().http://w3c.github.io/webappsec-csp/ is a specification implemented in web browsers that provides a feature that makes
eval()andnew Function()no-ops. Currently it uses very hand-wavy prose for that. I believe it is better for the definition of those features to acknowledge that feature, to ensure that the expected result is well-defined.