graphql-scalars PhoneNumber scalar is vulnerable to regular expression denial of service
What fixes it
No source in this snapshot names a fixed version. The vendor advisories under References are the place to check.
Reports 1
1 outlet mention it. Reports are not confirmation; each links to its source.
Description
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.
Text from CVE List
Affected versions 1
- graphql-scalarsaffected: >= 1.24.1, < 2.0.1CVE List
References 4
- github.com/graphql-hive/graphql-scalars/commit/210fd2485641afa2452800c00144245c74361701Fixvia CVE List
- github.com/graphql-hive/graphql-scalars/releases/tag/v2.0.1Fixvia CVE List
- github.com/graphql-hive/graphql-scalars/security/advisories/GHSA-x8rm-f576-gq67Advisoryvia CVE List
- github.com/graphql-hive/graphql-scalars/pull/2719Referencevia CVE List