vendor:
None
by:
Anonymous
8.8
CVSS
HIGH
Scope Fixing Vulnerability
20
CWE
Product Name: None
Affected Version From: Unknown
Affected Version To: Unknown
Patch Exists: No
Related CWE: None
CPE: None
Metasploit:
N/A
Other Scripts:
N/A
Platforms Tested: None
2020
Scope Fixing Vulnerability in Arrow Function
When the parser parses the parameter list of an arrow function containing destructuring assignments, it can't distinguish whether the assignments will be actually in the parameter list or just assignments until it meets a '=>' token. So it first assigns the destructuring assignments to the outer scope, and fixs the scope when it meets the '=>' token. However, the RewindDestructuringAssignments method is only called when the arrow function's body starts with a '{' token, which can lead to the scope of the inner destructuring assignments being set to the outer arrow function's scope.
Mitigation:
Ensure that the RewindDestructuringAssignments method is called after fixing the scope.