Repository navigation
fix(deps): update dependency graphql-scalars to v2 [security] - #8642
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
Contributor
|
Important Review skippedBot user detected. To trigger a single review, invoke the
|
renovate
Bot
force-pushed
the
renovate/npm-graphql-scalars-vulnerability
branch
from
November 5, 2026 20:51
4bb1907 to
e8d02e9
Compare
renovate
Bot
force-pushed
the
renovate/npm-graphql-scalars-vulnerability
branch
from
November 11, 2026 15:06
e8d02e9 to
2a6c01e
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:
1.25.0→2.0.11.26.0→2.0.1graphql-scalars PhoneNumber scalar is vulnerable to regular expression denial of service
CVE-2026-115887 / GHSA-x8rm-f576-gq67
More information
Details
Summary
The regular expression behind
GraphQLPhoneNumbersince 1.24.1 backtracks exponentially. A string made of a run of digits followed by one character that makes the match fail (for example"1".repeat(30) + "x") blocks the JavaScript thread for seconds, and every additional digit doubles the time.graphql-js calls
parseLiteralwhile validating a document andparseValuewhile coercing variables, so the regex runs for every request that merely contains such a value in aPhoneNumberposition, before execution and before any authentication or authorization step of the server. One small unauthenticated request is enough to stall a server process.Affected versions
graphql-scalars>= 1.24.1, <= 2.0.0 (2.0.0 is the currentlatest; the default branch still has the same pattern)./^\+[1-9]\d{6,14}$/.The payload was ran against 1.22.4, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.26.0 and 2.0.0: the first three reject it instantly, the other five show the exponential growth.
Root cause
src/scalars/PhoneNumber.ts:In
\d+\)?((\-|\x20)?\d+)+$the separator is optional, so a run of n digits can be split across the inner\d+and the outer+iterations in a number of ways that is exponential in n. When the overall match fails, for instance on a trailing non-digit, the engine tries all of them.Proof of concept
npm i graphql graphql-scalars@2.0.0):Measured warm, i.e. after ordinary inputs have been validated like in a running server:
The time doubles with every digit. The first execution of the regex in a fresh process is about 5x slower because V8 interprets a regexp on its first run (Node 22.19.0, 28 digits: 7.8 s).
echo(phone: PhoneNumber)field, 26 digits +x, Node 22.19.0, warm:parseLiteral, validation)parseValue, coercion){ __typename }request waited as long). A mutation that requires authentication was affected equally when called anonymously, because document validation runs before any authorization in resolvers or context.Impact
Denial of service. Any GraphQL server that exposes
PhoneNumberon an argument, an input object field or a variable can be stalled by a request of about 30 characters; roughly 40 characters would keep a process busy for hours (extrapolated from the doubling, not measured).serializeuses the same regex, so unvalidated stored values returned through aPhoneNumberfield are affected too. The actual severity depends on the scalar being applied to untrusted input, which is the typical case.Suggested fix
An equivalent pattern without ambiguous splits:
It accepts exactly the same strings as the current one, so there is no behaviour change: with
N = (S?\d+)+ = (S?\d)+a digit run is just repeated single-digit iterations, hence\d+\)?N = \d(\d*\))?N. Verification:1 + - space ( ) x: 47,079,208 strings (1,832 accepted), 0 differences;1 11 111 1111 11111 + - space ( ) x: 1,948,717 strings (100,380 accepted), 0 differences;Optionally also reject values above a sane length before matching; the grammar currently has no upper bound and E.164 allows at most 15 digits. Above roughly 10 million characters V8 aborts the match with a
RangeError(stack) after about 25 ms instead of returning false.A regression test that fails with the current implementation:
GraphQLPhoneNumber.parseValue('1'.repeat(40) + 'x')must throw its validation error immediately; with the current pattern it does not return in any reasonable time.Workarounds for users until a fix is released
--enable-experimental-regexp-engine-on-excessive-backtracks, or callv8.setFlagsFromString('--enable-experimental-regexp-engine-on-excessive-backtracks')before the regex first runs. V8 then falls back to its linear-time engine after excessive backtracking; verified on Node 22.19, 24.15 and 26.10. The flag is not accepted inNODE_OPTIONS.graphql-scalarsto <= 1.24.0 restores a linear pattern but changes which values are accepted (only+prefixed E.164).Coordination
We have not disclosed this publicly. We maintain Unchained Engine (
@unchainedshop/api), a downstream project that exposes this scalar on public input fields and will need to ship a mitigation of its own, so we would like to coordinate the timing of any public disclosure with you. Please let us know your preferred timeline, and whether you would like us to prepare a pull request (we can work in a temporary private fork if you enable one).Severity
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HReferences
This data is provided by the GitHub Advisory Database (CC-BY 4.0).
Release Notes
Urigo/graphql-scalars (graphql-scalars)
v2.0.1Compare Source
Patch Changes
210fd24Thanks @dotansimha! - Improve
PhoneNumberscalar regex parsingperformance
The new pattern accepts exactly the same values and matches in linear time.
v2.0.0Compare Source
Major Changes
#3096
b29c5c0Thanks @n1ru4l! - BREAKING Drop support for
graphql-js<16.0.0.BREAKING Drop support for Node.js 20
Patch Changes
b29c5c0Thanks @n1ru4l! - dependencies updates:
graphql@^16.0.0 || ^17.0.0↗︎ (from^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0,in
peerDependencies)v1.26.0Compare Source
Minor Changes
18d76c0Thanks @eddeee888! - Update graphql peerDeps to ^17.0.0
Patch Changes
18d76c0Thanks @eddeee888! - dependencies updates:
graphql@^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0↗︎(from
^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0,in
peerDependencies)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about these updates again.
This PR was generated by Mend Renovate. View the repository job log.