WebReflection flatted
flatted: Prototype Pollution via parse()
flatted is a circular JSON parser. Prior to version 3.4.2, the parse() function in flatted can use attacker-controlled string values from the parsed JSON as direct array index keys, without validating that they are numeric. Since the internal input buffer is a JavaScript Array, accessing it with the key "__proto__" returns Array.prototype via the inherited getter. This object is then treated as a legitimate parsed value and assigned as a property of the output object, effectively leaking a live reference to Array.prototype to the consumer. Any code that subsequently writes to that property will pollute the global prototype. This issue has been patched in version 3.4.2.
Affected versions and mitigation
From the CVE record and the vendor's references.Affected
- < 3.4.2
Fixed in 3.4.2
Mitigation
Upgrade flatted to 3.4.2 or later.
References
- Vendor advisory github.com/WebReflection/flatted/security/advi…
- Patch github.com/WebReflection/flatted/commit/885ddc…
- Release notes github.com/WebReflection/flatted/releases/tag/…
Timeline
Days relative to CVE publicationNo public PoC found yet; not in CISA KEV.
PoC repositories
Found on GitHub.No PoC repositories found yet.