Packages / @graphql-tools/utils / Security
GraphQL Tools has prototype pollution in well-established utility function `mergeDeep`
Affected releases · @graphql-tools/utils
- 12.x12.0.0Fixed in 12.0.1
- 11.x11.0.0 – 11.2.2No fix on this line yet
- 10.x10.0.0 – 10.11.0No fix on this line yet
- 9.x and older6.0.0 – 9.2.1No fix, no longer updated
On 12.x, the newest line:
npm install @graphql-tools/utils@12.0.1Not affected
13.0.0 – 13.1.3
7 releases, latest
Affected
12.0.0
1 release
Fixed
12.0.1 – 12.1.0
5 releases
Affected
11.0.0 – 11.2.2
7 releases
Affected
10.0.0 – 10.11.0
57 releases
Affected
9.0.0 – 9.2.1
9 releases
Affected
8.0.0 – 8.13.1
44 releases
Affected
7.0.0 – 7.10.0
31 releases
Affected
6.0.0 – 6.2.4
25 releases
Is your project affected?
Paste your package.json, or type the range you declare for @graphql-tools/utils. It is read in your browser and sent nowhere.
What happens
Closed by #8423 Mitigated in Hive Gateway by #2600
A client can alias fields to constructor, __proto__ or prototype so that the response keys from two subgraphs collide on those names during result merging. Because mergeDeep recursed through inherited properties, the merge walked {}.constructor to Object, then Object.__proto__ to Function.prototype, and wrote a subgraph-supplied value over Function.prototype.call, breaking every subsequent request in the process until restart. This is remotely triggerable by an unauthenticated client with a single query against any supergraph that merges an object from two subgraphs, which is the ordinary @shareable or entity case, so it is a denial of service rather than a theoretical hardening issue.
{
shared {
fieldA
constructor: fieldB {
__proto__: child {
call: value
}
}
}
}