Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessIdentify endpoint feeding convert()
-
DeliverySubmit record with parent='__proto__'
-
ExploitTrigger temp['__proto__'] prototype lookup
-
ExecutioninitPush writes to Object.prototype
-
PersistSubsequent code reads polluted property
-
ImpactLogic bypass or downstream RCE gadget
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A08:2025 - Software or Data Integrity Failures
ASVS 5.0
V4 - API and Web Service Object attribute protection
|
| Exploitation Conditions | The consuming application must call FlatToNested.prototype.convert() on records whose parent or id field is attacker-influenced (typical for the library's documented purpose - building trees from user, REST, or database input). Affected versions are <= 1.1.1 of npm flat-to-nested running on Node.js. No authentication, no user interaction, and no non-default configuration of the library are required; the malicious value '__proto__' is ordinary input data. The practical limit on severity is downstream: the pollution only escalates beyond logic corruption when the same process later reads the polluted property through a sink (template engine option, auth flag, command argument), so impact depends on the host application's code paths rather than on flat-to-nested itself. |
| Impact | The CVSS 3.1 vector AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N (7.5 High) reflects integrity-only impact reachable over the network without authentication or interaction, which matches the library's use as a data-shaping utility in web back-ends. There is no EPSS, KEV, or SSVC data provided, and no evidence of active exploitation; the practical risk is heavily dependent on whether downstream code uses polluted prototype properties as gadgets (template engines, option-merging, auth checks) - without such a gadget, impact is limited to logic corruption. Note the input lists CWE-915 while the advisory body calls out CWE-1321; both are in the prototype-pollution family but defenders tracking by CWE-1321 should be aware of the discrepancy. Overall this is a credible supply-chain integrity issue that should be patched promptly, but not an emergency in the absence of a known downstream RCE gadget in the specific consumer. |
| Exploit ScenarioDerived | A Node.js service exposes an endpoint that ingests JSON records (for example, a hierarchical category import or org-chart upload) and passes them to flat-to-nested's convert() to build a tree. An attacker submits a record like {id: 1, parent: '__proto__', isAdmin: true}; after the call, every newly created plain object in the process inherits an attacker-controlled property, which a downstream check such as if (user.isAdmin) or a templating engine's option merge can then honor - escalating from data corruption to authorization bypass or RCE depending on the gadget. A working proof-of-concept is published in the GHSA advisory itself. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv1 – Jun 19, 2026
Prototype pollution in the npm package flat-to-nested (versions <= 1.1.1) lets attackers who control input records pollute Object.prototype by supplying a record with parent set to the string '__proto__'. The convert() function uses plain objects as lookup tables and writes attacker-controlled data through the prototype chain via initPush(), affecting any application that feeds untrusted flat records (REST input, DB rows, user-supplied data) into the library. No CISA KEV listing and no public exploit identified at time of analysis beyond the proof-of-concept embedded in the GitHub Security Advisory.
RemediationAI
Vendor-released patch: upgrade flat-to-nested to 1.1.2 or later, which replaces the plain-object lookup tables with Object.create(null) so that '__proto__', 'constructor', and 'prototype' become harmless own keys rather than prototype-chain references (commit 680a5ebe1194edda16fa93baaa56ff14fe0e3d7f, advisory GHSA-hp36-v28f-w3r4). If upgrading is not immediately possible, pre-sanitize input records before calling convert() by rejecting or stripping any record whose id or parent equals '__proto__', 'constructor', or 'prototype' - note this is a strict allowlist on key strings and will reject any legitimate record that happens to use those exact identifiers. As an additional defense, run the consumer process under Node's --frozen-intrinsics flag or call Object.freeze(Object.prototype) at startup; this blocks the write but will break any library that legitimately augments Object.prototype, so test thoroughly before enabling in production.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 2 packages in npm, euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
flat-to-nested is a small JavaScript utility (pkg:npm/flat-to-nested) that converts flat parent/child records into a nested tree. In index.js, convert() initializes temp = {} and pendingChildOf = {} as plain objects that inherit from Object.prototype, then uses each record's id and parent fields directly as dynamic object keys without any allowlist or denylist. When parent === '__proto__', temp['__proto__'] resolves to Object.prototype and initPush() writes children data onto the global prototype. The root cause class is CWE-1321 / CWE-915 (improperly controlled modification of object prototype attributes), a well-known JavaScript sink-pattern where unsanitized strings used as keys cross the boundary between own properties and inherited prototype properties.
Know when the next one hits your stack
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:N
Library is typically reached via network-fed records with no auth or interaction; integrity is high (arbitrary prototype writes), with low availability impact from likely logic crashes and no direct confidentiality loss.
Primary rating from Vendor (https://github.com/joaonuno/flat-to-nested-js).
CVSS VectorVendor: https://github.com/joaonuno/flat-to-nested-js
DescriptionCVE.org
Summary
convert() builds the nested tree by using each flat record's id and parent field values directly as object keys, with no guard against __proto__ / constructor / prototype. A record whose parent is the string "__proto__" makes temp[parent] resolve to Object.prototype, and the following initPush(...) writes attacker-controlled data onto the global prototype. Any application that passes attacker-influenced records to convert() is affected, and the base prototype methods stay intact so the pollution is stealthy.
Details
In index.js, convert() (FlatToNested.prototype.convert):
temp = {}(line 45) andpendingChildOf = {}(line 46) are plain objects, so they inherit fromObject.prototype.- For each record,
parent = flatEl[this.config.parent](line 51) is taken verbatim from input. - Line 57:
if (temp[parent] ! undefined)- whenparent = "__proto__",temp["__proto__"]resolves via the prototype chain toObject.prototype, which is!== undefined, so the
branch is taken.
- Line 59:
initPush(this.config.children, temp[parent], flatEl)→ effectivelyinitPush("children", Object.prototype, flatEl). initPush(lines 4-9):Object.prototype["children"] = []thenObject.prototype["children"].push(flatEl)- attacker-controlled data is written onto the globalObject.prototype.
There is no sanitization of id / parent anywhere; they flow straight into temp[id], temp[parent], and pendingChildOf[parent] as dynamic keys.
PoC
const FlatToNested = require('flat-to-nested');
new FlatToNested().convert([
{ id: 1, parent: '__proto__', polluted: 'PWNED' }
]);
console.log(({}).children); // => [ { id: 1, polluted: 'PWNED' } ]
A freshly-created, unrelated object {} now carries an attacker-controlled children property. ({}).toString === Object.prototype.toString remains true, so existing methods are untouched (stealthy). If the consumer configures a custom children key, that arbitrary prototype property is polluted instead.Impact
Prototype pollution (CWE-1321). Any service that builds a tree from attacker-influenced flat records (the package's core purpose - e.g. records derived from a DB/REST/user input) can have Object.prototype polluted. Consequences range from application-logic corruption and denial of service to serving as a gadget toward privilege escalation or RCE depending on downstream sinks. No special privileges or user interaction required; the malicious value is ordinary input data.
Suggested fix
Use prototype-less lookup tables so inherited keys like __proto__ cannot be reached: var temp = Object.create(null); var pendingChildOf = Object.create(null); (Optionally also reject id/parent values equal to __proto__, constructor, or prototype.) Verified: with Object.create(null) for both temp and pendingChildOf, the PoC no longer pollutes Object.prototype and normal nesting output is unchanged. A patch with a regression test is ready.
Executive ViewAI
The flat-to-nested npm package versions 1.1.1 and earlier contain a prototype pollution vulnerability that allows attackers processing untrusted data to inject malicious objects into applications' core data structures. Any organization using this library to process REST API input, database records, or user-supplied data faces immediate risk of data corruption and potential cascading security failures. Patch availability makes remediation straightforward, but affected systems must be identified and updated urgently.
Apply vendor patch.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
Privilege escalation occurs when an attacker leverages flaws in access control mechanisms to gain permissions beyond what they were originally granted.
Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.
EUVD-2026-77691
GHSA-hp36-v28f-w3r4
NVD
CVE.org
EPSS
Exploit-DB