vendor:
N/A
by:
N/A
8,8
CVSS
HIGH
Type Confusion
811
CWE
Product Name: N/A
Affected Version From: N/A
Affected Version To: N/A
Patch Exists: No
Related CWE: N/A
CPE: N/A
Metasploit:
N/A
Other Scripts:
N/A
Tags: N/A
CVSS Metrics: N/A
Nuclei References:
N/A
Nuclei Metadata: N/A
Platforms Tested: N/A
2020
Type Confusion in JSC’s BytecodeGenerator::emitGetByVal
When the code generator meets (a) in the given JS code, it will call BytecodeGenerator::emitGetByVal. The method uses op_get_by_val to handle expressions like "o[i]". But, there is a fast path, which uses op_get_direct_pname, for when the index variable is a string. op_get_direct_pname is designed for a string index only. So if other types are used as indexes, it will cause type confusions. In the above JSC code, the index variable is an object, which will cause type confusion.
Mitigation:
Developers should ensure that the index variable is a string when using op_get_direct_pname.