GitHub Advisoryadvisory · npm
GHSA-4852-vrh7-28rf Reflected XSS in GraphQL Playground
HIGH
Official page ↗
- Aliases
- CVE-2020-4038
- Ecosystem
- npm
- Packages
- graphql-playground-html
- Severity
- High
- CVSS vector
- CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:C/C:N/I:H/A:N
- Weaknesses
- CWE-79
- Reviewed
- 2020-06-08
Affected packages
• npm graphql-playground-html: < 1.6.22 → fixed in 1.6.22
Description
Impact
directly impacted:
• `graphql-playground-html@ {
const { endpoint } = qs.parse(req.url)
res.html(renderPlaygroundPage({endpoint: sanitizeUrl(endpoint) })).status(200)
next()
}
```
or, with `graphql-playground-express`:
```js
const { expressPlayground } = require('graphql-playground-middleware-express');
const { sanitizeUrl } = require('@braintree/sanitize-url');
const qs = require('querystringify');
const { renderPlaygroundPage } = require('graphql-playground-html');
module.exports = (req, res, next) => {
const { endpoint } = qs.parse(req.url)
res.html(expressPlayground({endpoint: sanitizeUrl(endpoint) })).status(200)
next()
}
```
References
• OWASP: How to Test for CSS Reflection Attacks
• Original Report from Cure53 (jpg)
Credits
Masato Kinugawa of Cure53
For more information
If you have any questions or comments about this advisory:
• Open an issue in graphql-playground
• Email us at [email protected]
Related
Alias · CVE (1)
- CVE-2020-4038 GraphQL Playground (graphql-playground-html NPM package) before version 1.6.22 have a severe XSS Reflection attack vulnerability. vulnerability
Weakness · CWE (1)
- CWE-79 Improper Neutralization of Input During Web Page Generation weakness
References
- https://github.com/graphql/graphql-playground/security/advisories/GHSA-4852-vrh7-28rf web
- https://github.com/prisma-labs/graphql-playground/security/advisories/GHSA-4852-vrh7-28rf web
- https://nvd.nist.gov/vuln/detail/CVE-2020-4038 advisory
- https://github.com/prisma-labs/graphql-playground/commit/bf1883db538c97b076801a60677733816cb3cfb7 web
- https://github.com/prisma-labs/graphql-playground#security-details web