Common Weakness Enumeration

CWE-1321

Allowed

Improperly 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.

780 vulnerabilities reference this CWE, most recent first.

GHSA-HXCM-V35H-MG2X

Vulnerability from github – Published: 2019-06-07 21:12 – Updated: 2023-11-29 22:16
VLAI
Summary
Prototype Pollution in querystringify
Details

A vulnerability was found in querystringify before 2.0.0. It's possible to override built-in properties of the resulting query string object if a malicious string is inserted in the query string.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "querystringify"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "2.0.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2019-06-07T21:11:35Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "A vulnerability was found in querystringify before 2.0.0. It\u0027s possible to override built-in properties of the resulting query string object if a malicious string is inserted in the query string.",
  "id": "GHSA-hxcm-v35h-mg2x",
  "modified": "2023-11-29T22:16:43Z",
  "published": "2019-06-07T21:12:50Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/unshiftio/querystringify/pull/19"
    },
    {
      "type": "WEB",
      "url": "https://github.com/unshiftio/querystringify/commit/422eb4f6c7c28ee5f100dcc64177d3b68bb2b080"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "Prototype Pollution in querystringify"
}

GHSA-HXJ9-33PP-J2CC

Vulnerability from github – Published: 2025-12-09 17:11 – Updated: 2025-12-09 21:37
VLAI
Summary
Elysia vulnerable to prototype pollution with multiple standalone schema validation
Details

Prototype pollution vulnerability in mergeDeep after merging results of two standard schema validations with the same key. Due to the ordering of merging, there must be an any type that is set as a standalone guard, to allow for the __proto__ prop to be merged.

When combined with GHSA-8vch-m3f4-q8jf this allows for a full RCE by an attacker.

Impact

Routes with more than 2 standalone schema validation, eg. zod

Example vulnerable code:

import { Elysia } from "elysia"
import * as z from "zod"

const app = new Elysia()
    .guard({
        schema: "standalone",
        body: z.object({
            data: z.any()
        })
    })
    .post("/", ({ body }) => ({ body, win: {}.foo }), {
        body: z.object({
            data: z.object({
                messageId: z.string("pollute-me"),
            })
        })
    })

Patches

Patched by 1.4.17 (https://github.com/elysiajs/elysia/pull/1564)

Reference commit: - https://github.com/elysiajs/elysia/pull/1564/commits/26935bf76ebc43b4a43d48b173fc853de43bb51e - https://github.com/elysiajs/elysia/pull/1564/commits/3af978663e437dccc6c1a2a3aff4b74e1574849e

Workarounds

Remove __proto__ key from body

Example plugin for removing __proto__ from body

new Elysia()
    .onTransform(({ body, headers }) => {
        if (headers['content-type'] === 'application/json')
            return JSON.parse(JSON.stringify(body), (k, v) => {
                if (k === '__proto__') return

                return v
            })
    })
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "elysia"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "1.4.0"
            },
            {
              "fixed": "1.4.17"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2025-66456"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2025-12-09T17:11:53Z",
    "nvd_published_at": "2025-12-09T20:15:54Z",
    "severity": "CRITICAL"
  },
  "details": "Prototype pollution vulnerability in `mergeDeep` after merging results of two standard schema validations with the same key. Due to the ordering of merging, there must be an `any` type that is set as a `standalone` guard, to allow for the `__proto__` prop to be merged.\n\nWhen combined with GHSA-8vch-m3f4-q8jf this allows for a full RCE by an attacker.\n\n### Impact\nRoutes with more than 2 standalone schema validation, eg. zod\n\nExample vulnerable code:\n```typescript\nimport { Elysia } from \"elysia\"\nimport * as z from \"zod\"\n\nconst app = new Elysia()\n\t.guard({\n\t\tschema: \"standalone\",\n\t\tbody: z.object({\n\t\t\tdata: z.any()\n\t\t})\n\t})\n\t.post(\"/\", ({ body }) =\u003e ({ body, win: {}.foo }), {\n\t\tbody: z.object({\n\t\t\tdata: z.object({\n\t\t\t\tmessageId: z.string(\"pollute-me\"),\n\t\t\t})\n\t\t})\n\t})\n```\n\n### Patches\nPatched by 1.4.17 (https://github.com/elysiajs/elysia/pull/1564)\n\nReference commit:\n- https://github.com/elysiajs/elysia/pull/1564/commits/26935bf76ebc43b4a43d48b173fc853de43bb51e\n- https://github.com/elysiajs/elysia/pull/1564/commits/3af978663e437dccc6c1a2a3aff4b74e1574849e\n\n### Workarounds\nRemove `__proto__` key from body\n\nExample plugin for removing `__proto__` from body\n\n```typescript\nnew Elysia()\n\t.onTransform(({ body, headers }) =\u003e {\n\t\tif (headers[\u0027content-type\u0027] === \u0027application/json\u0027)\n\t\t\treturn JSON.parse(JSON.stringify(body), (k, v) =\u003e {\n\t\t\t\tif (k === \u0027__proto__\u0027) return\n\n\t\t\t\treturn v\n\t\t\t})\n\t})\n```",
  "id": "GHSA-hxj9-33pp-j2cc",
  "modified": "2025-12-09T21:37:06Z",
  "published": "2025-12-09T17:11:53Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-8vch-m3f4-q8jf"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elysiajs/elysia/security/advisories/GHSA-hxj9-33pp-j2cc"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2025-66456"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elysiajs/elysia/pull/1564"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elysiajs/elysia/commit/26935bf76ebc43b4a43d48b173fc853de43bb51e"
    },
    {
      "type": "WEB",
      "url": "https://github.com/elysiajs/elysia/commit/3af978663e437dccc6c1a2a3aff4b74e1574849e"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/elysiajs/elysia"
    },
    {
      "type": "WEB",
      "url": "https://github.com/sportshead/elysia-poc"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:H/VI:H/VA:N/SC:N/SI:N/SA:N",
      "type": "CVSS_V4"
    }
  ],
  "summary": "Elysia vulnerable to prototype pollution with multiple standalone schema validation"
}

GHSA-J28Q-P8WW-CP87

Vulnerability from github – Published: 2021-12-16 14:33 – Updated: 2021-12-15 15:23
VLAI
Summary
Prototype Pollution in merge-deep2.
Details

All versions of package merge-deep2 are vulnerable to Prototype Pollution via the mergeDeep() function.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "merge-deep2"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "3.0.6"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2021-23700"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-12-14T14:33:34Z",
    "nvd_published_at": "2021-12-10T20:15:00Z",
    "severity": "MODERATE"
  },
  "details": "All versions of package merge-deep2 are vulnerable to Prototype Pollution via the mergeDeep() function.",
  "id": "GHSA-j28q-p8ww-cp87",
  "modified": "2021-12-15T15:23:03Z",
  "published": "2021-12-16T14:33:09Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2021-23700"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/luyuan/merge-deep"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-JS-MERGEDEEP2-1727593"
    }
  ],
  "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:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Prototype Pollution in merge-deep2."
}

GHSA-J32X-J8PJ-PG2H

Vulnerability from github – Published: 2021-04-13 15:20 – Updated: 2021-03-22 22:36
VLAI
Summary
Prototype Pollution in decal
Details

This affects all versions of package decal. The vulnerability is in the extend function.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "decal"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "2.1.3"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-28450"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321",
      "CWE-400",
      "CWE-94"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-03-22T22:36:42Z",
    "nvd_published_at": "2021-02-04T15:15:00Z",
    "severity": "HIGH"
  },
  "details": "This affects all versions of package decal. The vulnerability is in the extend function.",
  "id": "GHSA-j32x-j8pj-pg2h",
  "modified": "2021-03-22T22:36:42Z",
  "published": "2021-04-13T15:20:34Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-28450"
    },
    {
      "type": "WEB",
      "url": "https://github.com/gigafied/decal.js/blob/master/src/utils/extend.js#L23-L56"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-JS-DECAL-1051028"
    },
    {
      "type": "WEB",
      "url": "https://www.npmjs.com/package/decal"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Prototype Pollution in decal"
}

GHSA-J452-XHG8-QG39

Vulnerability from github – Published: 2026-04-15 18:31 – Updated: 2026-04-16 21:33
VLAI
Summary
Mafintosh's protocol-buffers-schema is vulnerable to prototype pollution
Details

JavaScript is vulnerable to prototype pollution in Mafintosh's protocol-buffers-schema Version 3.6.0, where an attacker may alter the application logic, bypass security checks, cause a DoS or achieve remote code execution.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "protocol-buffers-schema"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "3.6.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-5758"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-04-16T21:33:53Z",
    "nvd_published_at": "2026-04-15T18:17:24Z",
    "severity": "MODERATE"
  },
  "details": "JavaScript is vulnerable to prototype pollution in Mafintosh\u0027s protocol-buffers-schema Version 3.6.0, where an attacker may alter the application logic, bypass security checks, cause a DoS or achieve remote code execution.",
  "id": "GHSA-j452-xhg8-qg39",
  "modified": "2026-04-16T21:33:53Z",
  "published": "2026-04-15T18:31:58Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-5758"
    },
    {
      "type": "WEB",
      "url": "https://github.com/mafintosh/protocol-buffers-schema/pull/70"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/mafintosh/protocol-buffers-schema"
    },
    {
      "type": "WEB",
      "url": "https://morielharush.github.io/2026/04/12/cve-2026-5758-protocol-buffers-schema-prototype-pollution"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:N/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Mafintosh\u0027s protocol-buffers-schema is vulnerable to prototype pollution"
}

GHSA-J4FX-XXWH-2485

Vulnerability from github – Published: 2026-05-16 06:30 – Updated: 2026-05-16 06:30
VLAI
Details

Versions of the package jsondiffpatch before 0.7.6 are vulnerable to Prototype Pollution via the jsondiffpatch.patch() and jsondiffpatch/formatters/jsonpatch.patch() APIs. An attacker can perform prototype pollution by supplying crafted delta or JSON Patch documents, as attacker-controlled property names and path segments are used to traverse and modify objects without restricting access to special properties like proto or constructor.prototype, allowing modification of Object.prototype.

Show details on source website

{
  "affected": [],
  "aliases": [
    "CVE-2026-8657"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": false,
    "github_reviewed_at": null,
    "nvd_published_at": "2026-05-16T06:16:18Z",
    "severity": "HIGH"
  },
  "details": "Versions of the package jsondiffpatch before 0.7.6 are vulnerable to Prototype Pollution via the jsondiffpatch.patch() and jsondiffpatch/formatters/jsonpatch.patch() APIs. An attacker can perform prototype pollution by supplying crafted delta or JSON Patch documents, as attacker-controlled property names and path segments are used to traverse and modify objects without restricting access to special properties like __proto__ or constructor.prototype, allowing modification of Object.prototype.",
  "id": "GHSA-j4fx-xxwh-2485",
  "modified": "2026-05-16T06:30:29Z",
  "published": "2026-05-16T06:30:29Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-8657"
    },
    {
      "type": "WEB",
      "url": "https://github.com/benjamine/jsondiffpatch/commit/381c0125efab49f6f0dbc08317d01d55717672af"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/yuki-matsuhashi/e570fb1579ae1f3190059b622b0473fb"
    },
    {
      "type": "WEB",
      "url": "https://github.com/benjamine/jsondiffpatch/blob/96112c35a98f9201dd75d67fcee68a952c79e2fe/packages/jsondiffpatch/src/filters/nested.ts%23L107-L115"
    },
    {
      "type": "WEB",
      "url": "https://github.com/benjamine/jsondiffpatch/blob/96112c35a98f9201dd75d67fcee68a952c79e2fe/packages/jsondiffpatch/src/filters/nested.ts%23L82-L87"
    },
    {
      "type": "WEB",
      "url": "https://github.com/benjamine/jsondiffpatch/blob/96112c35a98f9201dd75d67fcee68a952c79e2fe/packages/jsondiffpatch/src/formatters/jsonpatch-apply.ts%23L146-L168"
    },
    {
      "type": "WEB",
      "url": "https://github.com/benjamine/jsondiffpatch/blob/96112c35a98f9201dd75d67fcee68a952c79e2fe/packages/jsondiffpatch/src/formatters/jsonpatch-apply.ts%23L171-L199"
    },
    {
      "type": "WEB",
      "url": "https://security.snyk.io/vuln/SNYK-JS-JSONDIFFPATCH-16322990"
    }
  ],
  "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"
    },
    {
      "score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:H/VA:L/SC:N/SI:N/SA:N/E:P/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-J4RW-X3VG-C8R7

Vulnerability from github – Published: 2021-05-06 18:12 – Updated: 2021-05-05 18:40
VLAI
Summary
Prototype Pollution in node-oojs
Details

All versions of package node-oojs up to and including version 1.4.0 are vulnerable to Prototype Pollution via the setPath function.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "node-oojs"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "1.4.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-7721"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-05T18:40:32Z",
    "nvd_published_at": "2020-09-01T10:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "All versions of package node-oojs up to and including version 1.4.0 are vulnerable to Prototype Pollution via the setPath function.",
  "id": "GHSA-j4rw-x3vg-c8r7",
  "modified": "2021-05-05T18:40:32Z",
  "published": "2021-05-06T18:12:37Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-7721"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-JS-NODEOOJS-598678"
    }
  ],
  "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 node-oojs"
}

GHSA-J658-C2GF-X6PQ

Vulnerability from github – Published: 2026-05-09 00:40 – Updated: 2026-06-08 23:35
VLAI
Summary
Velocity.js has a Prototype Pollution vulnerability through #set path assignment
Details

Summary

A prototype pollution vulnerability was discovered in Velocity.js <= 2.1.5. This issue occurs during the processing of #set directives in Velocity templates. If an application renders a template controlled by an attacker, it is possible to modify Object.prototype, potentially leading to Denial of Service (DoS) or Remote Code Execution (RCE) depending on the server environment.

Details

The root cause is located in the #set path assignment logic within the source code: - File: /src/compile/set.ts - Issue: The engine accepts arbitrary path keys and performs assignments using the logic (baseRef as Record<string, unknown>)[key] = val.

Because there is no validation or filtering to block sensitive keys such as __proto__, constructor, or prototype, an attacker can traverse the prototype chain and pollute the global Object.prototype.

PoC

const {render} = require('velocityjs');
delete Object.prototype.polluted;
console.log({}.polluted); // ""
render('#set($__proto__.polluted = "hacked")', {});
console.log({}.polluted); // "hacked"
delete Object.prototype.polluted;

Impact

  • Vulnerability Type: Prototype Pollution
  • Who is impacted: Any application that renders Velocity templates where the template content can be influenced or controlled by untrusted users.
  • Severity: High. Prototype pollution can often be used to bypass security controls, cause application crashes (DoS), or be chained with other vulnerabilities to achieve code execution.
Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "velocityjs"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "2.1.5"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-44966"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-05-09T00:40:16Z",
    "nvd_published_at": "2026-05-26T22:16:43Z",
    "severity": "HIGH"
  },
  "details": "### Summary\nA prototype pollution vulnerability was discovered in Velocity.js \u003c= 2.1.5. This issue occurs during the processing of #set directives in Velocity templates. If an application renders a template controlled by an attacker, it is possible to modify Object.prototype, potentially leading to Denial of Service (DoS) or Remote Code Execution (RCE) depending on the server environment.\n\n### Details\nThe root cause is located in the #set path assignment logic within the source code:\n- File: /src/compile/set.ts \n- Issue: The engine accepts arbitrary path keys and performs assignments using the logic `(baseRef as Record\u003cstring, unknown\u003e)[key] = val`.\n\n\nBecause there is no validation or filtering to block sensitive keys such as \\_\\_proto\\_\\_, constructor, or prototype, an attacker can traverse the prototype chain and pollute the global Object.prototype.\n\n### PoC\n```javascript\nconst {render} = require(\u0027velocityjs\u0027);\ndelete Object.prototype.polluted;\nconsole.log({}.polluted); // \"\"\nrender(\u0027#set($__proto__.polluted = \"hacked\")\u0027, {});\nconsole.log({}.polluted); // \"hacked\"\ndelete Object.prototype.polluted;\n```\n\n### Impact\n- Vulnerability Type: Prototype Pollution\n- Who is impacted: Any application that renders Velocity templates where the template content can be influenced or controlled by untrusted users.\n- Severity: High. Prototype pollution can often be used to bypass security controls, cause application crashes (DoS), or be chained with other vulnerabilities to achieve code execution.",
  "id": "GHSA-j658-c2gf-x6pq",
  "modified": "2026-06-08T23:35:04Z",
  "published": "2026-05-09T00:40:16Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/shepherdwind/velocity.js/security/advisories/GHSA-j658-c2gf-x6pq"
    },
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-44966"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/shepherdwind/velocity.js"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "Velocity.js has a Prototype Pollution vulnerability through #set path assignment"
}

GHSA-J7CG-H9V9-6VQP

Vulnerability from github – Published: 2021-05-06 17:29 – Updated: 2023-09-07 22:07
VLAI
Summary
Prototype Pollution in irrelon-path and @irrelon/path
Details

The package irrelon-path before 4.7.0; the package @irrelon/path before 4.7.0 are vulnerable to Prototype Pollution via the set, unSet, pushVal and pullVal functions.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "irrelon-path"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.7.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    },
    {
      "package": {
        "ecosystem": "npm",
        "name": "@irrelon/path"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "4.7.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2020-7708"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321",
      "CWE-915"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2021-05-05T21:25:03Z",
    "nvd_published_at": "2020-08-18T15:15:00Z",
    "severity": "CRITICAL"
  },
  "details": "The package irrelon-path before 4.7.0; the package @irrelon/path before 4.7.0 are vulnerable to Prototype Pollution via the set, unSet, pushVal and pullVal functions.",
  "id": "GHSA-j7cg-h9v9-6vqp",
  "modified": "2023-09-07T22:07:24Z",
  "published": "2021-05-06T17:29:19Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2020-7708"
    },
    {
      "type": "WEB",
      "url": "https://github.com/Irrelon/irrelon-path/commit/8a126b160c1a854ae511659c111413ad9910ebe3"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/Irrelon/irrelon-path"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-JS-IRRELONPATH-598672"
    },
    {
      "type": "WEB",
      "url": "https://snyk.io/vuln/SNYK-JS-IRRELONPATH-598673"
    }
  ],
  "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 irrelon-path and @irrelon/path"
}

GHSA-J8PX-PJMP-325F

Vulnerability from github – Published: 2024-06-17 18:31 – Updated: 2024-07-05 21:16
VLAI
Summary
flatten-json Prototype Pollution
Details

A Prototype Pollution issue in flatten-json 1.0.1 allows an attacker to execute arbitrary code via module.exports.unflattenJSON (flatten-json/index.js:42)

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "npm",
        "name": "@allanlancioni/flatten-json"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "last_affected": "1.0.1"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2024-36574"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-1321"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2024-06-17T22:29:52Z",
    "nvd_published_at": "2024-06-17T16:15:15Z",
    "severity": "MODERATE"
  },
  "details": "A Prototype Pollution issue in flatten-json 1.0.1 allows an attacker to execute arbitrary code via module.exports.unflattenJSON (flatten-json/index.js:42)",
  "id": "GHSA-j8px-pjmp-325f",
  "modified": "2024-07-05T21:16:55Z",
  "published": "2024-06-17T18:31:33Z",
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://nvd.nist.gov/vuln/detail/CVE-2024-36574"
    },
    {
      "type": "WEB",
      "url": "https://gist.github.com/mestrtee/d5a0c93459599f77557b5bbe78b57325"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/AllanLancioni/flatten-json"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:L/I:L/A:L",
      "type": "CVSS_V3"
    }
  ],
  "summary": "flatten-json Prototype Pollution"
}

Mitigation
Implementation

By freezing the object prototype first (for example, Object.freeze(Object.prototype)), modification of the prototype becomes impossible.

Mitigation
Architecture and Design

By blocking modifications of attributes that resolve to object prototype, such as proto or prototype, this weakness can be mitigated.

Mitigation
Implementation

Strategy: Input Validation

When handling untrusted objects, validating using a schema can be used.

Mitigation
Implementation

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
Implementation

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.