Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[security] Server-side rendering docs allow XSS attack #4394

Closed
danilobuerger opened this issue Jan 31, 2019 · 1 comment
Closed

[security] Server-side rendering docs allow XSS attack #4394

danilobuerger opened this issue Jan 31, 2019 · 1 comment

Comments

@danilobuerger
Copy link
Contributor

danilobuerger commented Jan 31, 2019

https://www.apollographql.com/docs/react/features/server-side-rendering.html#store-rehydration

Don't use this technique!
<script>
  window.__APOLLO_STATE__ = client.extract();
</script>

allows for XSS as potential user input is not sanitised. See for example:
https://redux.js.org/recipes/server-rendering#security-considerations

@abernix
Copy link
Member

abernix commented Jul 12, 2019

The example in the documentation has been updated to include JSON.stringify after #4287, and I've updated the original comment here to ensure that this technique is not used.

@abernix abernix closed this as completed Jul 12, 2019
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants