# CVE-2021-41248: XSS vulnerability in GraphiQL

- Severity: High 7.1 (CVSS:3.1, scored by GitHub_M) `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 1.22%, higher than 69% of CVEs (2026-12-01)
- Published: 2021-11-04T20:15:11.000Z
- Modified: 2026-06-17T04:08:10.323Z
- Also known as: GHSA-x4r7-m2q9-69c8
- Related: CVE-2021-41249
- Weaknesses: CWE-79
- Assigned by: GitHub_M

## Description

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.

(As written by CVE List.)

## Affected

- graphql graphiql: >= 0.5.0, < 1.4.7; from 0.5.0 before 1.4.7
- graphiql (npm): from 0.5.0 before 1.4.7

## Every score

- GitHub_M: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L`
- GitHub: CVSS:3.1 7.1 High `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L`
- NVD: CVSS:3.1 4.7 Medium `CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:C/C:L/I:L/A:N`
- NVD: CVSS:2.0 2.6 Low `AV:N/AC:H/Au:N/C:N/I:P/A:N`

## References

- <https://github.com/graphql/graphiql/security/advisories/GHSA-x4r7-m2q9-69c8> (third-party-advisory, web)
- <https://github.com/graphql/graphql-playground/security/advisories/GHSA-59r9-6jp6-jcm7> (not-applicable, third-party-advisory, web)
- <https://github.com/graphql/graphiql/commit/cb237eeeaf7333c4954c752122261db7520f7bf4> (patch, third-party-advisory, web)
- <https://nvd.nist.gov/vuln/detail/CVE-2021-41248> (advisory)
- <https://github.com/graphql/graphiql/commit/6701b0b626e43800e32413590a295e5c1e3d5419#diff-d45eb76aebcffd27d3a123214487116fa95e0b5a11d70a94a0ce3033ce09f879R110> (web)
- <https://github.com/graphql/graphiql/commit/b9dec272d89d9c590727fd10d62e4a47e0317fc7#diff-855b77f6310b7e4fb1bcac779cd945092ed49fd759f4684ea391b45101166437R87> (web)
- <https://github.com/graphql/graphiql> (package)
- <https://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](https://www.cve.org/CVERecord?id=CVE-2021-41248), CVE Terms of Use, modified 2024-08-04
- GitHub Advisory Database: [GHSA-x4r7-m2q9-69c8](https://github.com/advisories/GHSA-x4r7-m2q9-69c8), CC-BY-4.0, modified 2026-02-04
- NVD: [CVE-2021-41248](https://nvd.nist.gov/vuln/detail/CVE-2021-41248), Public domain, modified 2026-06-17

---

Page: https://cve.day/CVE-2021-41248 · Whole record: https://cve.day/CVE-2021-41248.json · Rebuilt by cve.day 2026-11-25T22:58:05.359Z
