Closed by ardatan/graphql-tools#8423
Mitigated in Hive Gateway by graphql-hive/gateway#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
}
}
}
}
References
Closed by ardatan/graphql-tools#8423
Mitigated in Hive Gateway by graphql-hive/gateway#2600
A client can alias fields to
constructor,__proto__orprototypeso that the response keys from two subgraphs collide on those names during result merging. BecausemergeDeeprecursed through inherited properties, the merge walked{}.constructortoObject, thenObject.__proto__toFunction.prototype, and wrote a subgraph-supplied value overFunction.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@shareableor entity case, so it is a denial of service rather than a theoretical hardening issue.{ shared { fieldA constructor: fieldB { __proto__: child { call: value } } } }References