graphql-scalars PhoneNumber scalar is vulnerable to regular expression denial of service (CVE-2026-115887)
Published Last modified Sources: OSV, Hersteller, CVE.org
What is affected, what to do
Update graphql-scalars to version 2.0.1.
- Affected
- Graphql-hive Graphql-scalars
gte 1.24.1, < 2.0.1..*
- Graphql-hive Graphql-scalars
Not sure whether and how you are affected? Ask a question about this vulnerability
Metrics
7.5
Priority
XIEM Effective CVSS: highest available CVSS rating from NVD and vendor data.
Source: Vendor (CNA), CVSS v3
7.5
CVSS v3
Severity High on the scale from 0 to 10.
Source: OSV, Hersteller, CVE.org
0.4 %
EPSS score
Low — model estimates < 1% exploitation likelihood.
Source: FIRST EPSS, percentile 34.9
Show all metrics
- Severity
- High
Priority (0–325)
The priority score is a consolidated metric that condenses several individual signals into a single, action-guiding ranking: technical severity (CVSS), exploitation likelihood (EPSS), known-exploited status (KEV) and the context of the affected asset. The aim is to answer the only truly important question in vulnerability management: what first?
Read in glossary- 77.27 Methodology
Exploit maturity
An exploit is code or a technique that specifically uses a concrete vulnerability to force unintended behaviour — such as executing code or escalating privileges. It is the tool that turns a theoretical flaw into a practical attack.
Read in glossary- no public PoC known
XIEM Effective CVSS
XIEM® is the tiered managed-security operating model from NEOSEC and a registered trademark of NEOSEC GmbH. It extends classic SIEM — the central collection, normalisation and correlation of security-relevant events — with endpoint forensics, network visibility and deception technology, and consolidates them into three building tiers: Sentry, Orchestrate and Command.
Read in glossary- 7.5 Methodology
CVSS v3
CVSS is the globally established, open standard for assessing the technical severity of a vulnerability on a scale from 0 to 10. It describes how easily a flaw can be exploited and what damage it can cause — but not how likely its actual exploitation is. CVSS and the complementary EPSS deliberately answer different questions.
Read in glossary- 7.5
EPSS score
The EPSS score is the absolute model output for an individual vulnerability: the estimated probability of real-world exploitation within the next 30 days, expressed as a value between 0 and 1 (i.e. 0 % to 100 %). A score of 0.42 means „the model estimates a 42 % chance of real-world exploitation within 30 days“.
Read in glossary- 0.4 %
- Low — model estimates < 1% exploitation likelihood.
EPSS percentile
The EPSS percentile is the relative position of a vulnerability within all EPSS-scored CVEs, expressed as a value between 0 and 1. A percentile of 0.90 means „this CVE has a higher EPSS score than 90 % of all other scored CVEs“. Unlike the EPSS score, it is not a probability — but a positioning within a ranking.
Read in glossary- 34.9
- Elevated — this CVE ranks above at least 10% of all CVEs scored today.
KEV status
The KEV catalogue is a list maintained by the US authority CISA of vulnerabilities for which active exploitation in the wild has been confirmed. It answers not the question „how severe?“ but „is it already being attacked?“ — thereby sharply prioritising patching.
Read in glossary- —
- Published
CWE
CWE is a catalogue of typical weakness types in software and hardware — such as flawed input validation, unsafe memory handling or poor authentication. Where a CVE names a concrete vulnerability in a concrete product, a CWE describes the underlying class of defect.
Read in glossary- CWE-1333
Detection rules
No NEOSEC detection rule is available for this vulnerability yet.
Classification under NIS2 and CRA
Rule-based classification from exploitation status and severity. It does not replace a case-by-case assessment.
NIS2
NIS2 is EU Directive (EU) 2022/2555 to raise the level of cybersecurity across the Union. It substantially broadens obligations compared with the first NIS directive: more sectors, mandatory risk management, staged reporting duties and personal accountability of senior management.
Read in glossary- High technical severity: assess and remediate the vulnerability in vulnerability handling under Art. 21(2)(e) NIS2 and document the decision.
CRA
The CRA is EU Regulation (EU) 2024/2847 setting horizontal cybersecurity requirements for „products with digital elements“ — from industrial controllers and software to connected consumer devices. For the first time manufacturers must ensure security across the entire product lifecycle, handle vulnerabilities and provide security updates.
Read in glossary- From 11.12.2027, Annex I Part II CRA requires manufacturers of affected products with digital elements to handle vulnerabilities without delay and provide security updates.
ISO/IEC 27001
ISO/IEC 27001 is the internationally leading standard for an information security management system (ISMS). It describes a risk-based, process-oriented framework to systematically plan, implement, review and improve information security.
Read in glossary- Control A.8.8, management of technical vulnerabilities: assess relevance to your systems, plan remediation and keep evidence.
Description
Summary
The regular expression behind GraphQLPhoneNumber since 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 parseLiteral while validating a document and parseValue while coercing variables, so the regex runs for every request that merely contains such a value in a PhoneNumber position, 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).- Not affected: 1.24.0 and the earlier versions I checked (1.22.4, 1.23.0), which use the linear
/^\+[1-9]\d{6,14}$/. - Introduced by #2719 (c7f58da16, "PhoneNumber scalar is not fully compatible with E.164 format so updated regex to support phone number with extension"), released as 1.24.1 on 2025-01-29.
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:
const PHONE_NUMBER_REGEX = /^\+?\d{1,3}(\-|\x20)?\(?\d+\)?((\-|\x20)?\d+)+$/;
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
- The scalar alone (
npm i graphql graphql-scalars@2.0.0):
import { GraphQLPhoneNumber } from 'graphql-scalars';
for (const ok of ['+41791234567', '079 123 45 67', '+1 (123) 456-7890', 'nope']) {
try { GraphQLPhoneNumber.parseValue(ok); } catch {}
}
for (const digits of [24, 26, 28, 30]) {
const start = performance.now();
try { GraphQLPhoneNumber.parseValue('1'.repeat(digits) + 'x'); } catch {}
console.log(`${digits} digits: ${((performance.now() - start) / 1000).toFixed(2)} s`);
}
Measured warm, i.e. after ordinary inputs have been validated like in a running server:
| digits | Node 22.19.0 | Node 26.10.0 |
|---|---|---|
| 24 | 0.10 s | 0.07 s |
| 26 | 0.41 s | 0.29 s |
| 28 | 1.63 s | 1.14 s |
| 30 | 6.59 s | 4.62 s |
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).
- Through graphql-js, no server and no authentication: a schema with a single
echo(phone: PhoneNumber)field, 26 digits +x, Node 22.19.0, warm:
literal (parseLiteral, validation) | variable (parseValue, coercion) | |
|---|---|---|
| graphql 16.14.2 | 0.41 s | 0.43 s |
| graphql 17.0.2 | 0.41 s | 0.83 s (evaluated twice) |
- Also reproduced end to end against a GraphQL Yoga server: an anonymous HTTP request with a 27-digit value plus one invalid character stalled the whole process (a concurrent trivial
{ __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 PhoneNumber on 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). serialize uses the same regex, so unvalidated stored values returned through a PhoneNumber field 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:
const PHONE_NUMBER_REGEX = /^\+?\d{1,3}[- ]?\(?\d(?:\d*\))?(?:[- ]?\d)+$/;
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:
- exhaustive comparison of old and new pattern on every string up to length 9 over
1 + - space ( ) x: 47,079,208 strings (1,832 accepted), 0 differences; - every sequence of up to 6 tokens from
1 11 111 1111 11111 + - space ( ) x: 1,948,717 strings (100,380 accepted), 0 differences; - adversarial inputs (digit runs plus a failing character, digit/space and digit/dash alternations, parenthesis variants) scale linearly: 1,000,000 characters take about 10 ms, where the current pattern needs 0.3 s for 26.
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
- Replace the scalar in the schema with one that uses the pattern above.
- Run Node with
--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. - Pinning
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).
Source: OSV (Open Source Vulnerabilities), GitHub Security Advisories, NVD (NIST), cvelistv5
Affected products
The following versions are affected. Older releases of the same product line are also vulnerable unless stated otherwise.
| Affected versions | Fixed in | ||
|---|---|---|---|
| graphql-hive | graphql-scalars |
|
|
| npm | graphql-scalars |
|
|
Weakness classes (CWE)
CWE-1333Inefficient Regular Expression Complexity
Base
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
Entry at MITRE CWE-1333
References & sources
- github.comgraphql-hive/graphql-scalars/security/advisories/GHSA-x8rm-f576…x_refsource_CONFIRM, web
- github.comgraphql-hive/graphql-scalars/pull/2719x_refsource_MISC, web
- github.comgraphql-hive/graphql-scalars/commit/210fd2485641afa2452800c0014…x_refsource_MISC, web
- github.comgraphql-hive/graphql-scalars/releases/tag/v2.0.1x_refsource_MISC, web
- NVD (NIST)vuln/detail/CVE-2026-115887advisory
- github.comgraphql-hive/graphql-scalarspackage
Changes to this CVE
Who changed this CVE and when: NVD (analysis, affected products, CVSS), the CVE publisher (CNA) and additional providers such as CISA (ADP).
ReceivedGitHub
CVSS V3.1: AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness type: CWE-1333
Description added or changed
New references:- https://github.com/graphql-hive/graphql-scalars/commit/210fd2485641afa2452800c00144245c74361701
- https://github.com/graphql-hive/graphql-scalars/pull/2719
- https://github.com/graphql-hive/graphql-scalars/releases/tag/v2.0.1
- https://github.com/graphql-hive/graphql-scalars/security/advisories/GHSA-x8rm-f576-gq67
Show 8 original changes
Individual changes of this event as published by NVD Type Action Before After Description added —GraphQL Scalars is a library of custom GraphQL scalars for creating precise type-safe GraphQL schemas. From 1.24.1 until 2.0.1, GraphQLPhoneNumber in src/scalars/PhoneNumber.ts uses ambiguous nested digit quantifiers that backtrack exponentially when a PhoneNumber value contains a run of digits followed by a character that makes the match fail. GraphQL evaluates parseLiteral during document validation and parseValue during variable coercion before resolver authentication or authorization, so a small unauthenticated request can block the Node.js event loop and stall the server process. serialize is also affected when unvalidated stored values are returned through the scalar. This issue is fixed in version 2.0.1.CVSS added —AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HWeakness type (CWE) added —CWE-1333Affected versions (publisher) added —New affected value received. <a href="https://github.com/CVEProject/cvelistV5/blob/main/cves/2026/115xxx/CVE-2026-115887.json">CVE-2026-115887</a>Reference added —https://github.com/graphql-hive/graphql-scalars/commit/210fd2485641afa2452800c00144245c74361701Reference added —https://github.com/graphql-hive/graphql-scalars/pull/2719Reference added —https://github.com/graphql-hive/graphql-scalars/releases/tag/v2.0.1Reference added —https://github.com/graphql-hive/graphql-scalars/security/advisories/GHSA-x8rm-f576-gq67Source identifier: security-advisories@github.com
Embed badge
Show the severity and KEV status of this vulnerability on your site – with a link back here. The image is updated hourly.
<a href="https://intel.neosec.eu/en/cve/CVE-2026-115887"><img src="https://intel.neosec.eu/badge/cve/CVE-2026-115887.svg?lang=en" alt="CVE-2026-115887 – NEOSEC Intel" height="20"></a>