GitHub Advisoryadvisory · npm
GHSA-rf6f-7fwh-wjgh Prototype Pollution via parse() in NodeJS flatted
HIGH
Official page ↗
- Aliases
- CVE-2026-33228
- Ecosystem
- npm
- Packages
- flatted
- Severity
- High
- CVSS vector
- CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N/E:P
- Weaknesses
- CWE-1321, CWE-915
- Reviewed
- 2026-03-19
Affected packages
• npm flatted: < 3.4.2 → fixed in 3.4.2
Description
---
Summary
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.
---
Root Cause
File: esm/index.js:29 (identical in cjs/index.js)
```
const resolver = (input, lazy, parsed, $) => output => {
for (let ke = keys(output), {length} = ke, y = 0; y = 0 && idx < input.length)
? input[idx]
: undefined;
Related
Alias · CVE (1)
- CVE-2026-33228 flatted is a circular JSON parser. vulnerability
References
- https://github.com/WebReflection/flatted/security/advisories/GHSA-rf6f-7fwh-wjgh web
- https://nvd.nist.gov/vuln/detail/CVE-2026-33228 advisory
- https://github.com/WebReflection/flatted/commit/885ddcc33cf9657caf38c57c7be45ae1c5272802 web
- https://access.redhat.com/errata/RHSA-2026:13826 web
- https://access.redhat.com/errata/RHSA-2026:34342 web
- https://access.redhat.com/errata/RHSA-2026:9742 web
- https://access.redhat.com/security/cve/CVE-2026-33228 web
- https://bugzilla.redhat.com/show_bug.cgi?id=2449872 web
- https://github.com/WebReflection/flatted package
- https://github.com/WebReflection/flatted/releases/tag/v3.4.2 web