XSS vulnerability in GraphiQL
Key facts
- Attack vector
- Network
- Privileges required
- None
- User interaction
- Required
- Attack complexity
- High
- Impact type
- Cross-site scripting
- Confidentiality · integrity · availability
- High · High · Low
- Fix status
- Fixed
Attack profile from CVSS 3.1 · CNA. Fix status from CNA and GitHub. Impact type from CWE-79.
Summary
GraphiQL is the reference implementation of this monorepo, GraphQL IDE, an official project under the GraphQL Foundation. All versions of graphiql older than [email protected] are vulnerable to compromised HTTP schema introspection responses or schema prop values with malicious GraphQL type names, exposing a dynamic XSS attack surface that can allow code injection on operation autocomplete. In order for the attack to take place, the user must load a vulnerable schema in graphiql. There are a number of ways that can occur. By default, the schema URL is not attacker-controllable in graphiql or in its suggested implementations or examples, leaving only very complex attack vectors. If a custom implementation of graphiql's fetcher allows the schema URL to be set dynamically, such as a URL query parameter like ?endpoint= in graphql-playground, or a database provided value, then this custom graphiql implementation is vulnerable to phishing attacks, and thus much more readily available, low or no privelege level xss attacks. The URLs could look like any generic looking graphql schema URL. It should be noted that desktop clients such as Altair, Insomnia, Postwoman, do not appear to be impacted by this. This vulnerability does not impact codemirror-graphql, monaco-graphql or other dependents, as it exists in onHasCompletion.ts in graphiql. It does impact all forks of graphiql, and every released version of graphiql.
Why it matters now
SSVC decision points
Not available: CISA has not published SSVC decision points for this record.
Affected products
| Vendor | Product | Affected versions | Fixed in | Status | Source |
|---|---|---|---|---|---|
| graphql | graphiql | 0.5.0 to before 1.4.7 | 1.4.7 | Patch available | CNA |
| — | graphiql (npm) | 0.5.0 to before 1.4.7 | 1.4.7 | Patch available | GHSA-x4r7-m2q9-69c8 |
- graphiql Vendorgraphql Affected 0.5.0 to before 1.4.7 Fixed in 1.4.7 Patch available CNA
- graphiql (npm) Vendor— Affected 0.5.0 to before 1.4.7 Fixed in 1.4.7 Patch available GHSA-x4r7-m2q9-69c8
Remediation
- Fix · CNA graphiql (graphql) Fixed in 1.4.7
- Fix · GHSA-x4r7-m2q9-69c8 graphiql (npm) Fixed in 1.4.7 Advisory →
Timeline
- 2026-10-02 Threatist record created from CVE-2021-41248
- 2026-10-03 Alias added: GHSA-x4r7-m2q9-69c8
References
Advisory 3
Other 4
- https://github.com/graphql/graphiql/commit/6701b0b626e43800e32413590a295e5c1e3d5419#diff-d45eb76aebcffd27d3a123214487116fa95e0b5a11d70a94a0ce3033ce09f879R110
- https://github.com/graphql/graphiql/commit/b9dec272d89d9c590727fd10d62e4a47e0317fc7#diff-855b77f6310b7e4fb1bcac779cd945092ed49fd759f4684ea391b45101166437R87
- https://github.com/graphql/graphiql
- https://github.com/graphql/graphiql/blob/main/docs/security/2021-introspection-schema-xss.md#2-more-details-on-the-vulnerability
Sources
- CVE-2021-41248 · CVE Program
- CVE-2021-41248 · NVD
- FIRST EPSS
- GHSA-x4r7-m2q9-69c8 · GitHub Advisory Database · CC BY 4.0
This product uses the NVD API but is not endorsed or certified by the NVD. Sources and licences