CVE-2024-21529: Implicit String Coercion Prototype Pollution

The key `$K` is extracted from an array and checked against restricted properties (e.g., `__proto__`) using strict equality (`===`) without prior string coercion. An attacker can bypass this check by providing a nested array (e.g., `['__proto__']`). During property access (`$O[$K]`), implicit string coercion turns the array into the restricted key, leading t

Provally CuratedPublic repositoryHighMedium confidenceVerifiedApache-2.0JS
greprules fetch cve-2024-21529-implicit-string-coercion-prototype-pollution --engine opengrep

Description

The key `$K` is extracted from an array and checked against restricted properties (e.g., `__proto__`) using strict equality (`===`) without prior string coercion. An attacker can bypass this check by providing a nested array (e.g., `['__proto__']`). During property access (`$O[$K]`), implicit string coercion turns the array into the restricted key, leading t