Repository navigation
fix(deps): update dependency @graphql-tools/utils to v12 [security] - #1897
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/npm-graphql-tools-utils-vulnerability
branch
from
November 11, 2026 20:58
bc24f85 to
b24deda
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



This PR contains the following updates:
10.11.0→12.0.2GraphQL Tools: Prototype pollution in mergeIncrementalResult via non-primitive path segments
CVE-2026-114604 / GHSA-c4qx-w738-7hr3
More information
Details
Report metadata
@graphql-tools/utils(npm,pkg:github/ardatan/graphql-tools)mergeIncrementalResult/setObjectKeyPath(packages/utils/src/mergeIncrementalResult.ts)134d67ae36a559651f43ec7fe4a9da76f4a00c2b;masterHEADccca0ff0dc8ea20726fd116b2f19a38709c30e62; published npm builds 10.10.0, 10.10.1, 11.0.0, 12.0.0, 12.0.1@graphql-tools/utils>= 10.10.1 through the scanned 12.0.0 source; introduced byfbb58b51c4993ba9680ce6c2ef7203ab3a142713("remove dset dependency"). 12.0.1 also reproduces. 10.10.0 does not.packages/utils/src/index.ts:55)setObjectKeyPathis the only defense and it is on by defaultSummary
mergeIncrementalResultmerges an incremental GraphQL response part into an accumulated execution result by walking['data', ...incrementalResult.path]and assigning at the resolved location.setObjectKeyPathtries to reject dangerous segments with strict string equality against'__proto__','constructor'and'prototype'(lines 50-52 and 60-62), but it never validates that a path segment is a primitive string or number. A JSON path segment such as["__proto__"]is an array object, so["__proto__"] !== '__proto__'and the guard passes; the very next statement doescurrent[key], whoseToPropertyKeycoercion turns that array into the string key"__proto__"and resolvesObject.prototype. The following, innocuous-looking segment is then assigned directly ontoObject.prototype.In a consuming app,
incrementalResultis the response part being merged — data parsed from an upstream@defer/@streammultipart or incremental-delivery response from another GraphQL server or transport. TheExecutionResultTypeScript annotation is not a runtime check, so a malicious, compromised, or MITM'd upstream can choose thepathvalue and therefore choose global prototype keys and values in the gateway or client process.Comparable paths through the same helper, for contrast:
"__proto__"-> blocked by strict equality, lines 50-52 (confirmed by a control case in testing)["__proto__"]-> unsafe: passes the guard at lines 50-52, then coerced to the__proto__key at lines 53-57dset-> not exploitable (0/5 attack payloads succeeded)Impact
A malicious incremental GraphQL response can add arbitrary properties with attacker-chosen values to
Object.prototypein the consuming Node.js process. Because every plain object inherits from it, this can change authorization and configuration checks and the behavior of unrelated code elsewhere in the process — a networked PoC setObject.prototype.isAdmin = trueandObject.prototype.ownerEmail, after which a consumer-style checkopts.isAdmin === trueon a freshly created{}returnedtrue.The delta over the safe behaviour: without this traversal flaw, a hostile upstream response can only influence the GraphQL data returned to the caller — a bounded, in-band effect. With
path: [["__proto__"], "isAdmin"], the write lands onObject.prototype, escaping the response object entirely and affecting objects created later and code that never touches the response.Scoring note: this report deliberately carries no CVSS vector. No score was produced for it, and exploitability depends on the consuming application's data flow — specifically whether it merges incremental results from an upstream it does not control, and how much it relies on inherited defaults. Consumers who are not affected: anything on
@graphql-tools/utils10.10.0 or earlier (thedset-based implementation blocked all tested payloads); processes that freezeObject.prototype; and consumers that runtime-validate incrementalpathsegments to primitives before calling the helper. Note also thatgraphql-tools' own production code does not callmergeIncrementalResultdirectly — it is exported for consumers assembling incremental transport results.Preconditions
mergeIncrementalResulthelper on incremental payloads received from another GraphQL server or other untrusted transport. No special options are needed.pathsegments before the call. This is the default:packages/utils/src/index.ts:55exports the helper directly, with no runtime validation and no documented warning, and the behaviour is not documented as a caller responsibility.pathvalue — i.e. controls, has compromised, or can MITM the upstream subgraph/transport.Object.prototype.This requires no non-standard usage, monkey-patching, or unusual configuration: the documented happy path of the exported helper is affected. The only defense present in the code is the strict-equality forbidden-key check added at lines 50 and 60, which itself shows the author treats these path segments as untrusted input. No documentation warning about the trust requirement was found (documentation review is limited to the exported symbol at
packages/utils/src/index.ts:55; a broader docs audit is not verified).Data flow
incrementalResult.path, taken from the object passed to the public merge helper, is spread into the key path:const path = ['data', ...(incrementalResult.path ?? [])];(packages/utils/src/mergeIncrementalResult.ts:12).setObjectKeyPathcompares the unvalidated segment against the forbidden strings with===only; a non-primitive segment is never equal to any of them, so it passes unchanged (packages/utils/src/mergeIncrementalResult.ts:48-52).current[key]performsToPropertyKeycoercion, turning the array segment["__proto__"]into the key"__proto__"and resolvingObject.prototype; the following segment is then assigned on that resolved object:current[finalKey] = existingValue != null ? mergeDeep([existingValue, value]) : value(packages/utils/src/mergeIncrementalResult.ts:53-57, sink at:59-64).mergeIncrementalResult({ incrementalResult, executionResult }), exported directly atpackages/utils/src/index.ts:55for consumers that assemble incremental transport results. Testing confirmed thedata,items(@stream) and recursiveincremental[]branches are all affected.Vulnerable code
packages/utils/src/mergeIncrementalResult.ts, lines 12-64 at134d67ae36a559651f43ec7fe4a9da76f4a00c2b(extract; the...markers are elisions of intervening lines, not source text):key === '__proto__' || ..., lines 50-52) is the intended defense; it is safe only for primitive string segments.current = current[key](lines 53-57) is where a non-primitive segment is coerced into a forbidden key — this is the traversal that escapes the response object.current[finalKey] = ...(lines 59-64) is the sink: the write that lands onObject.prototype.Reproduction
Verified — reproduced dynamically, not only by inspection. Three independent reproductions were run:
packages/utils/src/{mergeIncrementalResult,mergeDeep,helpers}.tswere copied frommasterunchanged except for retargeting relative.jsimport specifiers to.ts, then run undernode --experimental-strip-types --test. 5/5 tests pass, including a control proving that the plain-string"__proto__"segment is blocked, while the payload{"path":[["__proto__"],"polluted"],"data":{"pwned":true}}setsObject.prototype.polluted = {pwned: true}and leaves theexecutionResultas{"data":{}}. Thedata,items(@stream) and recursiveincremental[]branches are all affected.dset, which blocks it); 10.10.1, 11.0.0, 12.0.0 and 12.0.1 = 5/5 attacks succeed. This differential confirms the affected range and thatfbb58b51c4993ba9680ce6c2ef7203ab3a142713introduced the issue; that commit is still the last one touching the file onmaster, so HEAD (ccca0ff0dc8ea20726fd116b2f19a38709c30e62) is unfixed.multipart/mixed@deferresponse whose deferred patches carrypath: [["__proto__"],"isAdmin"]. The client onlyJSON.parse()d the chunks and called the publicmergeIncrementalResult(). AfterwardsObject.getOwnPropertyNames(Object.prototype)containsisAdminandownerEmail,({}).isAdmin === true, and a consumer-style checkopts.isAdmin === trueon a fresh{}returnstrue.Minimal standalone reproduction:
Steps: run the above under Node against the built
@graphql-tools/utilspackage, then inspect a freshly created object after the merge.({} as any).pollutedremainsundefinedand no property is added toObject.prototype.Object.prototype;({} as any).pollutedis"yes"on a fresh object, whileexecutionResultis left as{"data":{}}.Suggested remediation
Validate the type of every path segment before it is used for property access, so that only primitive string/number keys ever reach bracket access — and compare against the forbidden names only after that validation.
A stronger variant, if it fits the project's style: build intermediate containers with
Object.create(null)and use own-property access (Object.prototype.hasOwnProperty.call) throughout the walk, so an inherited property can never be resolved or written even if a future guard is missed.Notes:
data,items(@stream) and the recursiveincremental[]handling — are affected by the same helper and are fixed together by validating insetObjectKeyPath.dset, were not exploitable by any of the tested payloads, so the regression is confined to the hand-rolled traversal added infbb58b51c4993ba9680ce6c2ef7203ab3a142713.Suggested regression test alongside the existing tests for
mergeIncrementalResult(exact spec file path: unknown — not identified in this review): assert that merging{"path":[["__proto__"],"polluted"],"data":"yes"}leaves({} as any).pollutedundefinedandObject.getOwnPropertyNames(Object.prototype)unchanged, with a paired control asserting the plain-string"__proto__"segment is still rejected, and equivalents for an object-valued segment (e.g.{"toString":() => "__proto__"}-style coercion) and for theitems/incremental[]branches.Resolution
Fixed in
@graphql-tools/utils@12.0.2, which is published on npm.setObjectKeyPathrejects a path unless every segment is a primitive string or number, and still blocks__proto__,constructor, andprototype. Upgrade to>=12.0.2.Severity
CVSS:4.0/AV:N/AC:L/AT:P/PR:N/UI:N/VC:L/VI:H/VA:H/SC:N/SI:N/SA:NReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
ardatan/graphql-tools (@graphql-tools/utils)
v12.0.2Compare Source
Patch Changes
#8456
b1fbba2Thanks @renovate! - dependencies updates:@whatwg-node/promise-helpers@^2.0.0↗︎ (from^1.0.0, independencies)#8467
20d36a5Thanks @ardatan! - Fix prototype pollution inmergeIncrementalResultPath segments are now rejected unless they are primitive strings or numbers, and keys named
__proto__,constructororprototypeare still blocked. Previously a non-primitive segment such as["__proto__"]bypassed the string equality guard and was coerced into a write onObject.prototype.Also exports shared
isSafeObjectKey/isDangerousObjectKeyhelpers used by this path walker and other package call sites.@graphql-tools/mergeand@graphql-tools/mockare patched so they ship with the new imports;updateInternalDependenciesraises their utils floor when12.0.2is versioned.v12.0.1Compare Source
Patch Changes
#8368
60db079Thanks @ardatan! - Omit mutation/subscription fromprintSchemaWithDirectiveswhen those root types are no longer present on the schema (e.g. afterpruneSchema).#8366
57e316dThanks @ardatan! - Allow%in paths checked byisValidPath(e.g. directories from URL-encoded repo names).#8370
1c1c5a0Thanks @ardatan! - Clean upobservableToAsyncIterablequeues and unsubscribe when the observable completes, so iterators do not retain references afterdone. Fixes leak detection flakes related to #8057.#8370
1c1c5a0Thanks @ardatan! - Prefer runtimedescriptionvalues over staleastNodedescriptions inprintSchemaWithDirectives/getDescriptionNode. Fixes #5508.#8423
0b9529fThanks @enisdenjo! - Fix prototype pollution inmergeDeepSource keys named
__proto__,constructororprototypeare now skipped at every recursion level, and the check for an existing key useshasOwnPropertyinstead ofin, so inherited properties are never used as merge targets.Previously, merging untrusted data such as
JSON.parse('{"constructor":{"__proto__":{"call":"x"}}}')could reach and overwrite properties onObject.prototypeorFunction.prototype.v12.0.0Compare Source
Major Changes
#8346
2273c21Thanks @ardatan! - This release adds GraphQL v17 support and aligns
the existing executor implementation with the latest GraphQL v17 API changes. The following
changes are included:
getAsyncHelpersis now available onGraphQLResolveInfo. Itstrackmethod is used wheneverwaitUntilis available, as in Yoga'sExplicit Resource Management
getAbortSignalis now available onGraphQLResolveInfo, matching behavior that was alreadyavailable in this executor implementation, as in Yoga's
Execution Cancellation
GraphQLResolveInfoautomatically alignsvariableValuesaccording to the GraphQL version forbetter compatibility. In GraphQL v17 and above,
variableValuesfollows the wrapped shape(
{ coerced, sources }) expected by GraphQL APIs. In GraphQL v16 and below,variableValuesremains a flat map as in previous versions.
__serializeand__parseValue, they are automaticallymapped to
coerceOutputValueandcoerceInputValuein GraphQL v17.@graphql-tools/executor'sgetVariableValuesnow returns{ variableValues }on success, where
variableValuesis aVariableValuesobject ({ coerced, sources }). Onfailure, it returns
{ errors }.collectFields,shouldIncludeNode,getDeferValues, andcollectSubFieldsnowneed a
VariableValuesobject instead ofRecord<string, any>for thevariableValuesargument.
visitResultnow internally normalizesExecutionRequest.variablesinto aVariableValues-compatible shape ({ coerced, sources }) before traversing selections.v11.2.2Compare Source
Patch Changes
e90719bThanks @pbomb! - fix mergeDeep to treat explicit undefined property
values as overrides rather than skipping them, distinct from an absent property
v11.2.1Compare Source
Patch Changes
615c1a2Thanks @pbomb! - fix mergeDeep to treat null property values as
explicit overrides rather than skipping them
v11.2.0Compare Source
Minor Changes
2609c94Thanks @eddeee888! - getDocumentNodeFromSchema: Add arg
defaultValue support for graphql@17
v11.1.1Compare Source
Patch Changes
#8256
981d461Thanks @twavv! - Fix
mergeDeepreturningundefinedinstead of{}when merging two or more empty objects.
Previously the output accumulator was only initialized inside the per-key loop, so merging sources
with no own keys (e.g.
mergeDeep([{}, {}])) left itundefined. This silently droppedempty-object values during nested merges (
{ data: {} }became{ data: undefined }), whichcould surface as "Cannot return null for non-nullable field" errors when stitching schemas. The
accumulator is now initialized as soon as an object source is encountered.
v11.1.0Compare Source
Minor Changes
a4b7dceThanks @enisdenjo! - Deep merge and preserve non-enumerable
symbols
v11.0.1Compare Source
Patch Changes
ae36a0eThanks @mattkrick! - Handle enum values correctly if they are
arguments of directives defined in the extensions
v11.0.0Compare Source
Major Changes
#7685
6f3776cThanks @ardatan! - Support "federation/subgraph style" schemas in
astFromSchemaandprintSchemaWithDirectivesIf a
GraphQLSchemadoesn't have any defined operation types, we should print the schemadefinition as an extension rather than omitting it entirely. They are not a valid schema on their
own, but they are valid subgraph schemas in a federation setup, and it is possible to build such
schemas with
assumeValidoptions.POTENTIAL BREAKING CHANGE: This can be a breaking change because now the schema above will be
printed as the input, previously
extend schemawas converted toschema {}.Configuration
📅 Schedule: (in timezone Europe/London)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.