Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editorial: more explicit validation in CreateDynamicFunction #2374

Merged
merged 1 commit into from
Apr 28, 2021

Conversation

bakkot
Copy link
Contributor

@bakkot bakkot commented Apr 5, 2021

Fixes #2373. cc @erights

spec.html Outdated Show resolved Hide resolved
@erights
Copy link

erights commented Apr 6, 2021

I am not a reviewer, but FWIW, LGTM. Thanks much!

Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understand where @erights is coming from in #2373, but I find this piecemeal parsing, then re-parsing the entire text only for the Early Error application to be misleading. It's misleading in that it suggests that parsing expr using exprSym alone is somehow insufficient to do all the validation while it in fact is.

I'd prefer to keep to a single parse and have a NOTE that says the syntactic constraint that @erights wants highlighted is applied post-concatenation. Then again, I don't find that state of affairs particularly surprising or indirect as he does.

@bakkot
Copy link
Contributor Author

bakkot commented Apr 6, 2021

I think this might actually be normatively necessary - that is, I think #2348 might accidentally not have been editorial after all.

Consider new Function('/*', '*/ ) {'). This shouldn't be legal, I believe that #2348 accidentally made it so.

@erights
Copy link

erights commented Apr 6, 2021

@bakkot Nice example! I tried to come up with one but did not. Thanks!

@syg
Copy link
Contributor

syg commented Apr 6, 2021

Consider new Function('/', '/ ) {'). This shouldn't be legal, I believe that #2348 accidentally made it so.

Ah ha, I retract my above comment then.

Copy link
Contributor

@syg syg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm with comment

spec.html Show resolved Hide resolved
@erights
Copy link

erights commented Apr 8, 2021

I like it. But your example is worth a thousand such explanations since most of us didn't see how the original text was erroneous even after we started looking for a counter-example. Your example is tiny and clarifying. It would be a good addition.

@bakkot
Copy link
Contributor Author

bakkot commented Apr 9, 2021

Added my above example as another NOTE.

@bakkot bakkot added the editor call to be discussed in the next editor call label Apr 14, 2021
@bakkot bakkot added ready to merge Editors believe this PR needs no further reviews, and is ready to land. and removed editor call to be discussed in the next editor call labels Apr 14, 2021
@ljharb ljharb force-pushed the more-explicit-fn-ctor branch from c263627 to c754979 Compare April 28, 2021 22:21
@ljharb ljharb merged commit c754979 into master Apr 28, 2021
@ljharb ljharb deleted the more-explicit-fn-ctor branch April 28, 2021 22:25
leobalter pushed a commit to leobalter/ecma262 that referenced this pull request May 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Editors believe this PR needs no further reviews, and is ready to land.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

URGENT SECURITY Function constructor spec creates massive code injection vulnerability
5 participants