CVE-2021-41248 json
XSS vulnerability in GraphiQL
published 2021-11-04 5 y ago modified 2026-06-17 4 mo ago also GHSA-x4r7-m2q9-69c8 , EUVD-2021-2411
- cvss
- 7.1
- version 3.1, CNA
- cisa kev
- Not listed
- not in CISA's catalog
- epss
- 1.3%
- EPSS 1.3% chance of exploitation in 30 days, percentile 69%
- public exploits
- 0
- none known
Summary
GraphiQL is the reference implementation of this monorepo, GraphQL IDE, an official project under the GraphQL Foundation. All versions of graphiql older than graphiql@1.4.7 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.
Patch / fix
- npm graphiql 1.4.7
- graphql graphiql 1.4.7
Exploit prediction
1.26% chance of exploitation in the next 30 days, higher than 69% of all scored CVEs (FIRST EPSS, 2026-11-08).
CVSS scores
| assigned by | version | score | vector |
|---|---|---|---|
| CNA | 3.1 | 7.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L |
| NVD | 3.1 | 4.7 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N |
| NVD | 2.0 | 2.6 | AV:N/AC:H/Au:N/C:N/I:P/A:N |
| GitHub | 3.1 | 7.1 | CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L |
Affected packages
| ecosystem | package | affected | fixed in |
|---|---|---|---|
| npm | graphiql | >=0.5.0, <1.4.7 |
1.4.7 |
Affected products
- graphql graphiql
Classification
- Weakness
-
- CWE-79 Improper Neutralization of Input During Web Page Generation
References
-
github.com
/graphql/graphiql/commit/cb237eeeaf7333c4954c752122261db7520f7bf4
web, patch, third-party-advisory
-
github.com
/graphql/graphiql/commit/6701b0b626e43800e32413590a295e5c1e3d5419#diff-d45eb76aebcffd27d3a123214487116fa95e0b5
web
-
github.com
/graphql/graphiql/commit/b9dec272d89d9c590727fd10d62e4a47e0317fc7#diff-855b77f6310b7e4fb1bcac779cd945092ed49fd
web
-
github.com
/graphql/graphiql/security/advisories/GHSA-x4r7-m2q9-69c8
web, third-party-advisory
-
github.com
/graphql/graphql-playground/security/advisories/GHSA-59r9-6jp6-jcm7
web, not-applicable, third-party-advisory
-
nvd.nist.gov
/vuln/detail/CVE-2021-41248
advisory
-
github.com
/graphql/graphiql
package
-
github.com
/graphql/graphiql/blob/main/docs/security/2021-introspection-schema-xss.md#2-more-details-on-the-vulnerability
web
Sources
- CVE List CVE-2021-41248
- GitHub Advisory GHSA-x4r7-m2q9-69c8
- NVD CVE-2021-41248
Fencer Vulns keeps one entry per vulnerability: the CVE id wins, then GHSA, and records that alias each other are merged, except that two CVEs always keep separate entries. The same data is available as JSON.