CWE-1321
AllowedImproperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')
Abstraction: Variant · Status: Incomplete
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.
952 vulnerabilities reference this CWE, most recent first.
GHSA-V2MW-5MCH-W8C5
Vulnerability from github – Published: 2025-03-10 18:31 – Updated: 2025-03-17 15:41An issue in canvg prior to v.4.0.3 and v3.0.11 can lead to prototype pollution via the Constructor of the class StyleElement.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "canvg"
},
"ranges": [
{
"events": [
{
"introduced": "4.0.0"
},
{
"fixed": "4.0.3"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "canvg"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.0.11"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-25977"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2025-03-12T15:33:44Z",
"nvd_published_at": "2025-03-10T16:15:13Z",
"severity": "HIGH"
},
"details": "An issue in canvg prior to v.4.0.3 and v3.0.11 can lead to prototype pollution via the Constructor of the class StyleElement.",
"id": "GHSA-v2mw-5mch-w8c5",
"modified": "2025-03-17T15:41:44Z",
"published": "2025-03-10T18:31:56Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-25977"
},
{
"type": "WEB",
"url": "https://github.com/canvg/canvg/issues/1749"
},
{
"type": "WEB",
"url": "https://github.com/canvg/canvg/commit/c3743e6345f3e01aefdcdd412c3f26494f4b5d7d"
},
{
"type": "PACKAGE",
"url": "https://github.com/canvg/canvg"
},
{
"type": "WEB",
"url": "https://github.com/canvg/canvg/blob/937668eced93e0335c67a255d0d2277ea708b2cb/src/Document/StyleElement.ts"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "canvg Prototype Pollution vulnerability"
}
GHSA-V39H-QM32-8GWQ
Vulnerability from github – Published: 2021-12-09 19:57 – Updated: 2021-07-29 15:53express-mock-middleware through 0.0.6 is vulnerable to Prototype Pollution. Exported functions by the package can be tricked into adding or modifying properties of the Object.prototype. Exploitation of this vulnerability requires creation of a new directory where an attack code can be placed which will then be exported by express-mock-middleware. As such, this is considered to be a low risk.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "express-mock-middleware"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "0.0.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2020-7616"
],
"database_specific": {
"cwe_ids": [
"CWE-1321",
"CWE-915"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-25T17:28:15Z",
"nvd_published_at": "2020-04-07T14:15:00Z",
"severity": "MODERATE"
},
"details": "express-mock-middleware through 0.0.6 is vulnerable to Prototype Pollution. Exported functions by the package can be tricked into adding or modifying properties of the `Object.prototype`. Exploitation of this vulnerability requires creation of a new directory where an attack code can be placed which will then be exported by `express-mock-middleware`. As such, this is considered to be a low risk.",
"id": "GHSA-v39h-qm32-8gwq",
"modified": "2021-07-29T15:53:05Z",
"published": "2021-12-09T19:57:29Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-7616"
},
{
"type": "WEB",
"url": "https://github.com/LingyuCoder/express-mock-middleware/blob/master/lib/index.js#L39"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-EXPRESSMOCKMIDDLEWARE-564120"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Improperly Controlled Modification of Dynamically-Determined Object Attributes in express-mock-middleware"
}
GHSA-V39P-96QG-C8RF
Vulnerability from github – Published: 2021-09-01 18:37 – Updated: 2023-09-08 21:25This affects the package object-path before 0.11.6. A type confusion vulnerability can lead to a bypass of CVE-2020-15256 when the path components used in the path parameter are arrays. In particular, the condition currentPath === '__proto__' returns false if currentPath is ['__proto__']. This is because the === operator returns always false when the type of the operands is different.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "object-path"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.11.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-23434"
],
"database_specific": {
"cwe_ids": [
"CWE-1321",
"CWE-843"
],
"github_reviewed": true,
"github_reviewed_at": "2021-08-30T18:16:08Z",
"nvd_published_at": "2021-08-27T17:15:00Z",
"severity": "MODERATE"
},
"details": "This affects the package object-path before 0.11.6. A type confusion vulnerability can lead to a bypass of CVE-2020-15256 when the path components used in the path parameter are arrays. In particular, the condition `currentPath === \u0027__proto__\u0027` returns false if `currentPath` is `[\u0027__proto__\u0027]`. This is because the `===` operator returns always false when the type of the operands is different.",
"id": "GHSA-v39p-96qg-c8rf",
"modified": "2023-09-08T21:25:42Z",
"published": "2021-09-01T18:37:11Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23434"
},
{
"type": "WEB",
"url": "https://github.com/mariocasciaro/object-path/commit/7bdf4abefd102d16c163d633e8994ef154cab9eb"
},
{
"type": "PACKAGE",
"url": "https://github.com/mariocasciaro/object-path"
},
{
"type": "WEB",
"url": "https://github.com/mariocasciaro/object-path#0116"
},
{
"type": "WEB",
"url": "https://github.com/mariocasciaro/object-path%230116"
},
{
"type": "WEB",
"url": "https://lists.debian.org/debian-lts-announce/2023/01/msg00031.html"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JAVA-ORGWEBJARSNPM-1570423"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-OBJECTPATH-1569453"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Prototype Pollution in object-path"
}
GHSA-V3C7-FG8Q-9W96
Vulnerability from github – Published: 2025-09-05 09:30 – Updated: 2025-09-05 09:30Vulnerability of exposing object heap addresses in the Ark eTS module. Impact: Successful exploitation of this vulnerability may affect availability.
{
"affected": [],
"aliases": [
"CVE-2025-58280"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-09-05T08:15:31Z",
"severity": "HIGH"
},
"details": "Vulnerability of exposing object heap addresses in the Ark eTS module.\nImpact: Successful exploitation of this vulnerability may affect availability.",
"id": "GHSA-v3c7-fg8q-9w96",
"modified": "2025-09-05T09:30:35Z",
"published": "2025-09-05T09:30:35Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-58280"
},
{
"type": "WEB",
"url": "https://consumer.huawei.com/en/support/bulletin/2025/9"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-V3WP-JVW4-XCP3
Vulnerability from github – Published: 2026-10-15 00:31 – Updated: 2026-10-15 00:31n8n before 1.123.83, 2.x before 2.41.4, and 2.42.x before 2.42.1 contains a prototype pollution vulnerability in the AI workflow builder, which merges workflow connections using node names as object members without checking for reserved keys. Authenticated users can create nodes named proto through the API and invoke the connect-nodes operation to pollute the global object prototype, disrupting the instance until restart.
{
"affected": [],
"aliases": [
"CVE-2026-110848"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-14T23:17:25Z",
"severity": "MODERATE"
},
"details": "n8n before 1.123.83, 2.x before 2.41.4, and 2.42.x before 2.42.1 contains a prototype pollution vulnerability in the AI workflow builder, which merges workflow connections using node names as object members without checking for reserved keys. Authenticated users can create nodes named __proto__ through the API and invoke the connect-nodes operation to pollute the global object prototype, disrupting the instance until restart.",
"id": "GHSA-v3wp-jvw4-xcp3",
"modified": "2026-10-15T00:31:17Z",
"published": "2026-10-15T00:31:17Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/n8n-io/n8n/security/advisories/GHSA-3p2g-2wpm-8h3g"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-110848"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/n8n-before-1.123.83-2.41.4-and-2.42.1-prototype-pollution-via-ai-workflow-builder-connection-merge"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
GHSA-V42Q-78W8-8FCC
Vulnerability from github – Published: 2022-07-26 00:01 – Updated: 2022-08-06 09:34All versions of package set-deep-prop are vulnerable to Prototype Pollution via the main functionality.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "set-deep-prop"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-23373"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2022-08-06T09:34:51Z",
"nvd_published_at": "2022-07-25T14:15:00Z",
"severity": "CRITICAL"
},
"details": "All versions of package set-deep-prop are vulnerable to Prototype Pollution via the main functionality.",
"id": "GHSA-v42q-78w8-8fcc",
"modified": "2022-08-06T09:34:51Z",
"published": "2022-07-26T00:01:05Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23373"
},
{
"type": "WEB",
"url": "https://security.snyk.io/vuln/SNYK-JS-SETDEEPPROP-1083231"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "set-deep-prop Prototype Pollution"
}
GHSA-V55M-3W98-233J
Vulnerability from github – Published: 2025-02-06 06:31 – Updated: 2025-02-06 15:32A prototype pollution in the lib.fromQuery function of underscore-contrib v0.3.0 allows attackers to cause a Denial of Service (DoS) via supplying a crafted payload.
{
"affected": [],
"aliases": [
"CVE-2024-57081"
],
"database_specific": {
"cwe_ids": [
"CWE-1321",
"CWE-400"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-02-05T22:15:32Z",
"severity": "HIGH"
},
"details": "A prototype pollution in the lib.fromQuery function of underscore-contrib v0.3.0 allows attackers to cause a Denial of Service (DoS) via supplying a crafted payload.",
"id": "GHSA-v55m-3w98-233j",
"modified": "2025-02-06T15:32:52Z",
"published": "2025-02-06T06:31:26Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-57081"
},
{
"type": "WEB",
"url": "https://gist.github.com/tariqhawis/4b2c7273054f0d70ef162aa5b6daec01"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
]
}
GHSA-V5MP-JGW5-2X6J
Vulnerability from github – Published: 2026-09-03 20:55 – Updated: 2026-09-03 20:55Summary
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
- 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" ```
- Observe that a freshly created object inherits the injected key, confirming
Object.prototypewas modified:
yes
- 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:
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:
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:
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:
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:
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 ontoObject.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.
tomlreports roughly 14.8 million weekly downloads and around 1,340 dependents, so the transitive exposure is large. Dependents that passtomlas the engine to front-matter or configuration loaders inherit the issue.
Credit: Duy Bui / @calif.io
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "toml"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.1.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-63376"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2026-09-03T20:55:32Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"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\u0027s 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); // -\u003e \"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); // -\u003e \"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); // -\u003e \"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 \u2014 root has no prototype\n// ...\ntarget[k] = Object.create(null); // line 64 \u2014 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 \u003c 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 \u0026\u0026 valueAssignments.has(traversedPath)) {\n genError(\"Cannot redefine existing key \u0027\" + traversedPath + \"\u0027.\", off); // line 197 \u2014 the guard\n }\n ctx = ctx[key]; // line 200 \u2014 follows __proto__ into the prototype chain\n if (ctx instanceof Array \u0026\u0026 ctx.length \u0026\u0026 i \u003c 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 \u2014 for example the number `1` stored at `a.b.y` \u2014 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\") -\u003e 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 \u2014 uploaded configuration, project manifests, multi-tenant settings, package metadata \u2014 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/)",
"id": "GHSA-v5mp-jgw5-2x6j",
"modified": "2026-09-03T20:55:32Z",
"published": "2026-09-03T20:55:32Z",
"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"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:H/A:L",
"type": "CVSS_V3"
}
],
"summary": "toml-node: Prototype Pollution Leads to `Object.prototype` Corruption via `__proto__` Key-Path Desynchronization"
}
GHSA-V5VG-G7RQ-363W
Vulnerability from github – Published: 2021-11-08 17:40 – Updated: 2022-07-15 20:23This affects versions of package json-pointer up to and including 0.6.1. A type confusion vulnerability can lead to a bypass of CVE-2020-7709 when the pointer components are arrays.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.6.1"
},
"package": {
"ecosystem": "npm",
"name": "json-pointer"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-23820"
],
"database_specific": {
"cwe_ids": [
"CWE-1321",
"CWE-843"
],
"github_reviewed": true,
"github_reviewed_at": "2021-11-04T16:55:47Z",
"nvd_published_at": "2021-11-03T18:15:00Z",
"severity": "MODERATE"
},
"details": "This affects versions of package `json-pointer` up to and including `0.6.1`. A type confusion vulnerability can lead to a bypass of CVE-2020-7709 when the pointer components are arrays.",
"id": "GHSA-v5vg-g7rq-363w",
"modified": "2022-07-15T20:23:13Z",
"published": "2021-11-08T17:40:49Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23820"
},
{
"type": "WEB",
"url": "https://github.com/manuelstofer/json-pointer/pull/36"
},
{
"type": "WEB",
"url": "https://github.com/manuelstofer/json-pointer/commit/931b0f9c7178ca09778087b4b0ac7e4f505620c2"
},
{
"type": "PACKAGE",
"url": "https://github.com/manuelstofer/json-pointer"
},
{
"type": "WEB",
"url": "https://github.com/manuelstofer/json-pointer/blob/master/index.js%23L78"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-JSONPOINTER-1577287"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L",
"type": "CVSS_V3"
}
],
"summary": "Prototype Pollution in json-pointer"
}
GHSA-V659-54CX-G4QR
Vulnerability from github – Published: 2021-05-17 20:57 – Updated: 2021-05-25 20:44Prototype pollution vulnerability in 'deep-override' versions 1.0.0 through 1.0.1 allows an attacker to cause a denial of service and may lead to remote code execution.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "deep-override"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.0.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-25941"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2021-05-17T17:59:32Z",
"nvd_published_at": "2021-05-14T14:15:00Z",
"severity": "CRITICAL"
},
"details": "Prototype pollution vulnerability in \u0027deep-override\u0027 versions 1.0.0 through 1.0.1 allows an attacker to cause a denial of service and may lead to remote code execution.",
"id": "GHSA-v659-54cx-g4qr",
"modified": "2021-05-25T20:44:52Z",
"published": "2021-05-17T20:57:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-25941"
},
{
"type": "WEB",
"url": "https://github.com/ASaiAnudeep/deep-override/commit/2aced17651fb684959a6e04b1465a8329b3d5268"
},
{
"type": "WEB",
"url": "https://www.whitesourcesoftware.com/vulnerability-database/CVE-2021-25941"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "Prototype Pollution in deep-override"
}
Mitigation
By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.
Mitigation
By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.
Mitigation
Strategy: Input Validation
When handling untrusted objects, validating using a schema can be used.
Mitigation
By using an object without prototypes (via Object.create(null) ), adding object prototype attributes by accessing the prototype via the special attributes becomes impossible, mitigating this weakness.
Mitigation
Map can be used instead of objects in most cases. If Map methods are used instead of object attributes, it is not possible to access the object prototype or modify it.
CAPEC-1: Accessing Functionality Not Properly Constrained by ACLs
In applications, particularly web applications, access to functionality is mitigated by an authorization framework. This framework maps Access Control Lists (ACLs) to elements of the application's functionality; particularly URL's for web apps. In the case that the administrator failed to specify an ACL for a particular element, an attacker may be able to access it with impunity. An attacker with the ability to access functionality not properly constrained by ACLs can obtain sensitive information and possibly compromise the entire application. Such an attacker can access resources that must be available only to users at a higher privilege level, can access management sections of the application, or can run queries for data that they otherwise not supposed to.
CAPEC-180: Exploiting Incorrectly Configured Access Control Security Levels
An attacker exploits a weakness in the configuration of access controls and is able to bypass the intended protection that these measures guard against and thereby obtain unauthorized access to the system or network. Sensitive functionality should always be protected with access controls. However configuring all but the most trivial access control systems can be very complicated and there are many opportunities for mistakes. If an attacker can learn of incorrectly configured access security settings, they may be able to exploit this in an attack.
CAPEC-77: Manipulating User-Controlled Variables
This attack targets user controlled variables (DEBUG=1, PHP Globals, and So Forth). An adversary can override variables leveraging user-supplied, untrusted query variables directly used on the application server without any data sanitization. In extreme cases, the adversary can change variables controlling the business logic of the application. For instance, in languages like PHP, a number of poorly set default configurations may allow the user to override variables.