Commit aa3a41f
Fix XSS vulnerability in GraphiQL config injection
Security scan flagged an XSS vector where unsanitized query parameters
could break out of the <script> context when embedded in the HTML page.
Solution:
- Escape <, >, and & characters when embedding JSON in the HTML script tag
- Use Unicode escapes (\u003c, \u003e, \u0026) instead of HTML entities
- Unicode escapes are decoded by JavaScript's JSON parser, preserving the
original query text for GraphiQL
- HTML entities (like >) would NOT be decoded inside <script> tags,
breaking GraphQL query syntax
This prevents XSS while maintaining correct functionality.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>1 parent c509e57 commit aa3a41f
1 file changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
191 | 197 | | |
192 | 198 | | |
193 | 199 | | |
| |||
0 commit comments