Skip to content

Commit 6623379

Browse files
committed
Update graphiql to 1.4.7 for security reason
"All versions of graphiql < 1.4.7 are vulnerable to an XSS attack." https://github.com/graphql/graphiql/blob/ab2b52f06213bd9bf90c905c1b460b6939f3d856/docs/security/2021-introspection-schema-xss.md
1 parent aac23bc commit 6623379

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

graphql_server/render_graphiql.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Based on (express-graphql)[https://github.com/graphql/express-graphql/blob/master/src/renderGraphiQL.js] and
1+
"""Based on (express-graphql)[https://github.com/graphql/express-graphql/blob/main/src/renderGraphiQL.ts] and
22
(subscriptions-transport-ws)[https://github.com/apollographql/subscriptions-transport-ws]"""
33
import json
44
import re
@@ -7,7 +7,7 @@
77
from jinja2 import Environment
88
from typing_extensions import TypedDict
99

10-
GRAPHIQL_VERSION = "1.0.3"
10+
GRAPHIQL_VERSION = "1.4.7"
1111

1212
GRAPHIQL_TEMPLATE = """<!--
1313
The request to this GraphQL server provided the header "Accept: text/html"
@@ -34,12 +34,12 @@
3434
}
3535
</style>
3636
<link href="//cdn.jsdelivr.net/npm/graphiql@{{graphiql_version}}/graphiql.css" rel="stylesheet" />
37-
<script src="//cdn.jsdelivr.net/npm/promise-polyfill@8.1.3/dist/polyfill.min.js"></script>
38-
<script src="//cdn.jsdelivr.net/npm/unfetch@4.1.0/dist/unfetch.umd.js"></script>
39-
<script src="//cdn.jsdelivr.net/npm/react@16.13.1/umd/react.production.min.js"></script>
40-
<script src="//cdn.jsdelivr.net/npm/react-dom@16.13.1/umd/react-dom.production.min.js"></script>
37+
<script src="//cdn.jsdelivr.net/npm/promise-polyfill@8.2.0/dist/polyfill.min.js"></script>
38+
<script src="//cdn.jsdelivr.net/npm/unfetch@4.2.0/dist/unfetch.umd.js"></script>
39+
<script src="//cdn.jsdelivr.net/npm/react@16.14.0/umd/react.production.min.js"></script>
40+
<script src="//cdn.jsdelivr.net/npm/react-dom@16.14.0/umd/react-dom.production.min.js"></script>
4141
<script src="//cdn.jsdelivr.net/npm/graphiql@{{graphiql_version}}/graphiql.min.js"></script>
42-
<script src="//cdn.jsdelivr.net/npm/[email protected].16/browser/client.js"></script>
42+
<script src="//cdn.jsdelivr.net/npm/[email protected].18/browser/client.js"></script>
4343
<script src="//cdn.jsdelivr.net/npm/[email protected]/browser/client.js"></script>
4444
</head>
4545
<body>
@@ -308,9 +308,8 @@ async def render_graphiql_async(
308308
jinja_env: Optional[Environment] = config.get("jinja_env")
309309

310310
if jinja_env:
311-
# This method returns a Template. See https://jinja.palletsprojects.com/en/2.11.x/api/#jinja2.Template
312311
template = jinja_env.from_string(graphiql_template)
313-
if jinja_env.is_async: # type: ignore
312+
if jinja_env.is_async:
314313
source = await template.render_async(**template_vars)
315314
else:
316315
source = template.render(**template_vars)

0 commit comments

Comments
 (0)