The vulnerability is a prototype pollution in @graphql-tools/utils's mergeIncrementalResult helper. The root cause is that setObjectKeyPath (introduced in commit fbb58b51c4993ba9680ce6c2ef7203ab3a142713, which replaced the dset dependency) only validated path segments against forbidden names using strict string equality (===), but never validated that each segment is a primitive string/number. A non-primitive segment such as the array ["proto"] is not strictly equal to the string "proto", so it passes the guard; the subsequent current[key] access performs ToPropertyKey coercion, turning the array into the key "proto" and resolving Object.prototype. The following segment's write (current[finalKey] = ...) then lands on Object.prototype, polluting the global prototype.
The two vulnerable functions are:
- mergeIncrementalResult — the public entry point that spreads attacker-controlled incrementalResult.path into the key path without runtime validation.
- setObjectKeyPath — the sink that performs the unvalidated property traversal and write.
The fix (commits 20d36a5c6eb8fd5524420988e01a48618c450d70 and 19f5b3373fd7ace0688d19950fc529ce8347952a) adds isSafeObjectKey/isSafeKeyPath validation (rejecting non-primitive segments) and hasOwnProperty checks, confirming these are the vulnerable functions. Since this is a TypeScript/JavaScript package, profilers would show the plain function names without namespace/module paths.