All vulnerabilities

npm

CVE-2026-115887

graphql-scalars PhoneNumber scalar is vulnerable to regular expression denial of service

Severity
High 7.5
Published
28 Oct 2026
Last changed
30 Oct 2026
Added to UpHeron
23 Nov 2026
Fixed in
2.0.1
Exploit chance
0.6% in the next 30 daysHigher than 48% of CVEs. EPSS by FIRST, 24 Nov 2026
Weakness
Regular expression denial of service (ReDoS) (CWE-1333)
Attack
Over the network · No login needed · No user action needed
Attacker can
Take it down
CVSS vector
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Also known as
GHSA-x8rm-f576-gq67
Sources
OSV.dev and GitHub

Description

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.

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.

From the GitHub Advisory Database, CC BY 4.0. Shortened; the full text is there.

Workarounds

  • Replace the scalar in the schema with one that uses the pattern above.
  • Run Node with --enable-experimental-regexp-engine-on-excessive-backtracks, or call v8.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 in NODE_OPTIONS.
  • Pinning graphql-scalars to <= 1.24.0 restores a linear pattern but changes which values are accepted (only + prefixed E.164).
Workarounds as given by the GitHub Advisory Database, CC BY 4.0.

Affected software

SoftwareAffected versions
graphql-scalarsnpm · osv:npm:graphql-scalars
  • From 1.24.1 before 2.0.1

About graphql-scalars

Weekly downloads (npm)
5,380,564npm, 23 Nov 2026

This is the only vulnerability in graphql-scalars in our list.

References