Skip to content

Change to address CVE-2016-7207 - #1979

Merged
chakrabot merged 1 commit into
chakra-core:release/1.3from
pleath:release/1611.1.3
Nov 10, 2016
Merged

Change to address CVE-2016-7207#1979
chakrabot merged 1 commit into
chakra-core:release/1.3from
pleath:release/1611.1.3

Conversation

@pleath

@pleath pleath commented Nov 10, 2016

Copy link
Copy Markdown
Contributor

Fix incorrect identification of non-local-references when parsing arrow function parameter lists. Since we can't identify such syntax on the initial scan and have to backtrack and re-parse, our stacks of identifier references enter an inconsistent state that causes us to bind non-existent references and treat them as closure-captured. This in turn leads to bad byte code generation. The problem is easy to solve in the case of a single arrow function parameter not enclosed in parentheses. To handle the harder case of a list enclosed in parens, advance the current block ID when we begin parsing a parenthetical expression. Identifier references will be created that are amenable to the arrow function case, and if we do wind up with an arrow function, we only need to correct the function ID's on the references we've already made.

…ow function parameter lists. Since we can't identify such syntax on the initial scan and have to backtrack and re-parse, our stacks of identifier references enter an inconsistent state that causes us to bind non-existent references and treat them as closure-captured. This in turn leads to bad byte code generation. The problem is easy to solve in the case of a single arrow function parameter not enclosed in parentheses. To handle the harder case of a list enclosed in parens, advance the current block ID when we begin parsing a parenthetical expression. Identifier references will be created that are amenable to the arrow function case, and if we do wind up with an arrow function, we only need to correct the function ID's on the references we've already made.
@pleath

pleath commented Nov 10, 2016

Copy link
Copy Markdown
Contributor Author

@aneeshdk This is related to the arrow function parameter fix you reviewed previously.

@suwc

suwc commented Nov 10, 2016

Copy link
Copy Markdown

:shipit:

@suwc

suwc commented Nov 10, 2016

Copy link
Copy Markdown

LGTM

@chakrabot
chakrabot merged commit 1ea9ef6 into chakra-core:release/1.3 Nov 10, 2016
chakrabot pushed a commit that referenced this pull request Nov 10, 2016
Merge pull request #1979 from pleath:release/1611.1.3

Fix incorrect identification of non-local-references when parsing arrow function parameter lists. Since we can't identify such syntax on the initial scan and have to backtrack and re-parse, our stacks of identifier references enter an inconsistent state that causes us to bind non-existent references and treat them as closure-captured. This in turn leads to bad byte code generation. The problem is easy to solve in the case of a single arrow function parameter not enclosed in parentheses. To handle the harder case of a list enclosed in parens, advance the current block ID when we begin parsing a parenthetical expression. Identifier references will be created that are amenable to the arrow function case, and if we do wind up with an arrow function, we only need to correct the function ID's on the references we've already made.
chakrabot pushed a commit that referenced this pull request Nov 10, 2016
Merge pull request #1979 from pleath:release/1611.1.3

Fix incorrect identification of non-local-references when parsing arrow function parameter lists. Since we can't identify such syntax on the initial scan and have to backtrack and re-parse, our stacks of identifier references enter an inconsistent state that causes us to bind non-existent references and treat them as closure-captured. This in turn leads to bad byte code generation. The problem is easy to solve in the case of a single arrow function parameter not enclosed in parentheses. To handle the harder case of a list enclosed in parens, advance the current block ID when we begin parsing a parenthetical expression. Identifier references will be created that are amenable to the arrow function case, and if we do wind up with an arrow function, we only need to correct the function ID's on the references we've already made.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants