7.5
High
flat-to-nested

CVE-2026-55091

CVE-2026-55091 is a high-severity security vulnerability in flat-to-nested (npm), affecting versions <= 1.1.1. It is fixed in 1.1.2.

Key facts
CVSS score
7.5
High
Attack vector
Network
Issuing authority
GitHub Advisory Database
Affected package
flat-to-nested
Fixed in
1.1.2
Disclosed
2026

Summary

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) and pendingChildOf = {} (line 46) are plain objects, so they inherit from Object.prototype. For each record, parent = flatEl[this.config.parent] (line 51) is taken verbatim from input. Line 57: if (temp[parent] !== undefined), when parent === "proto", temp["proto"] resolves via the prototype chain to Object.prototype, which is !== undefined, so the branch is taken. Line 59: initPush(this.config.children, temp[parent], flatEl) → effectively initPush("children", Object.prototype, flatEl). initPush (lines 4-9): Object.prototype["children"] = [] then Object.prototype["children"].push(flatEl), attacker-controlled data is written onto the global Object.prototype. There is no sanitization of id / parent anywhere; they flow straight into temp[id], temp[parent], and pendingChildOf[parent] as dynamic keys. ### PoC js 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.

Impact

Severity and exposure

CVE-2026-55091 has a CVSS score of 7.5 (High). The vector is network-reachable, no privileges required, and no user interaction. A CVSS score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether this affects your application depends on whether the vulnerable code is present and reachable in your environment.

A fixed version is available (1.1.2). Upgrading removes the vulnerable code path.

Affected versions

npm

  • flat-to-nested (<= 1.1.1)

Security releases

  • flat-to-nested → 1.1.2 (npm)
Kodem intelligence

Severity tells you how bad this could be in the worst case. It does not tell you whether you are exposed. Exploitability and impact are functions of runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A vulnerable package can sit in your dependency tree and never run.

Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter instead of chasing every advisory.

Kodem's runtime-powered SCA identifies whether CVE-2026-55091 is reachable in your applications. Explore open-source security for your team.

See if CVE-2026-55091 is reachable in your applications. Get a demo

Remediation advice

Upgrade flat-to-nested to 1.1.2 or later to resolve this vulnerability.

Kodem Kai can prioritize this vulnerability in your dependency tree and generate a fix recommendation.

Frequently asked questions about CVE-2026-55091

What is CVE-2026-55091?

CVE-2026-55091 is a high-severity security vulnerability in flat-to-nested (npm), affecting versions <= 1.1.1. It is fixed in 1.1.2.

How severe is CVE-2026-55091?

CVE-2026-55091 has a CVSS score of 7.5 (High). This score reflects the worst-case severity of the vulnerability, not your specific exposure. Whether it represents real risk in your environment depends on whether the vulnerable code is present and reachable.

Which versions of flat-to-nested are affected by CVE-2026-55091?

flat-to-nested (npm) versions <= 1.1.1 is affected.

Is there a fix for CVE-2026-55091?

Yes. CVE-2026-55091 is fixed in 1.1.2. Upgrade to this version or later.

Is CVE-2026-55091 exploitable, and should I be worried?

Whether CVE-2026-55091 is exploitable in your environment depends on whether the vulnerable code is present and reachable. A CVSS score is a worst-case rating; it does not account for your specific deployment, configuration, or usage patterns. Kodem, an Intelligent Application Security platform, uses runtime intelligence to show which vulnerabilities actually execute in production, so you can focus on the ones that represent real risk. Get a demo

What actually determines whether CVE-2026-55091 is exploitable, and how bad it is?

Exploitability and impact are not fixed properties of a CVE. They depend on runtime truth: whether the vulnerable code is present, reachable, and actually executes in your application. A high CVSS score on a dependency that never runs is not the same as real risk. Kodem, an Intelligent Application Security platform, uses runtime intelligence to reveal which vulnerabilities actually execute in production, so teams prioritize the ones that genuinely matter.

How do I fix CVE-2026-55091?

Upgrade flat-to-nested to 1.1.2 or later.

Stop the waste.
Protect your environment with Kodem.