Miggo Logo

CVE-2021-41248: GraphiQL introspection schema template injection attack

7.1

CVSS Score
3.1

Basic Information

EPSS Score
0.59814%
Published
11/8/2021
Updated
2/1/2023
KEV Status
No
Technology
TechnologyJavaScript

Technical Details

CVSS Vector
CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:L
Package NameEcosystemVulnerable VersionsFirst Patched Version
graphiqlnpm>= 0.5.0, < 1.4.71.4.7

Vulnerability Intelligence
Miggo AIMiggo AI

Miggo AIRoot Cause Analysis

The vulnerability stems from how GraphiQL handles schema type names in autocomplete suggestions. The advisory specifically identifies the vulnerability in onHasCompletion.ts, where type names were directly interpolated into HTML via innerHTML without proper escaping. The commit history shows this code existed since 2016 and was moved to TypeScript. The attack demonstration shows XSS triggers during autocomplete (typing {u), which maps to this completion handler. The patch added HTML escaping to this component, confirming this as the vulnerable location.

Vulnerable functions

Only Mi**o us*rs **n s** t*is s**tion

WAF Protection Rules

WAF Rule

- [*. Imp**t](#**-imp**t) - [*. S*op*](#**-s*op*) - [*. P*t***s](#**-p*t***s) - [*.* **N *un*l* impl*m*nt*tions m*y ** *utom*ti**lly p*t****](#***-**n-*un*l*-impl*m*nt*tions-m*y-**-*utom*ti**lly-p*t****) - [*. Work*roun*s *or Ol**r V*rsio

Reasoning

T** vuln*r**ility st*ms *rom *ow *r*p*iQL **n*l*s s***m* typ* n*m*s in *uto*ompl*t* su***stions. T** **visory sp**i*i**lly i**nti*i*s t** vuln*r**ility in `on**s*ompl*tion.ts`, w**r* typ* n*m*s w*r* *ir**tly int*rpol*t** into *TML vi* `inn*r*TML` wit