The vulnerability is a regular expression denial of service (ReDoS) in the graphql-scalars PhoneNumber scalar. The root cause is the regex PHONE_NUMBER_REGEX = /^\+?\d{1,3}(\-|\x20)?\(?\d+\)?((\-|\x20)?\d+)+$/ introduced in commit c7f58da16 (PR #2719, released in 1.24.1). In the portion \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 exponentially many ways, causing catastrophic backtracking when the overall match fails (e.g., a trailing non-digit character).
The fix commit 210fd2485641afa2452800c00144245c74361701 (released as 2.0.1) replaces the regex with the linear-time equivalent /^\+?\d{1,3}[- ]?\(?\d(?:\d*\))?(?:[- ]?\d)+$/, which consumes each digit with exactly one quantifier.
The vulnerable functions are the three methods of the GraphQLPhoneNumber scalar object that invoke PHONE_NUMBER_REGEX.test(...):
serialize(value) — runs the regex on output values (unvalidated stored data returned through a PhoneNumber field).
parseValue(value) — runs the regex during variable coercion (graphql-js calls this for variables).
parseLiteral(ast) — runs the regex during document validation (graphql-js calls this while validating a document, before execution and before any authentication/authorization).
All three are confirmed by the patch: the fix commit modifies the shared PHONE_NUMBER_REGEX constant used by all three methods, and the added regression tests in tests/PhoneNumber.test.ts explicitly exercise serialize, parseValue, and parseLiteral with the adversarial payload '1'.repeat(30) + 'x'. Since this is a JavaScript/TypeScript library, profiler output strips namespace/module paths, so the function names are reported as GraphQLPhoneNumber.serialize, GraphQLPhoneNumber.parseValue, and GraphQLPhoneNumber.parseLiteral.