-
-
Notifications
You must be signed in to change notification settings - Fork 165
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
SXSS via caching - theme= #213
Comments
Some notes, if you pass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Critical issue
https://github.com/pacocoursey/next-themes/blob/main/packages/next-themes/src/index.tsx#L83
Example:
Append to URL: ?theme=%27-console.log(%27test/%27%2bdocument.domain)-%27
forcedTheme enabled on Provider
Not everybody has CSP enabled so make sure to sanitize the data attribute/class
The value of the "theme" parameter is reflected on the page, this reflection is then stored with the page/cache. So if someone else visits that page (without using any payload) the previously injected javascript will still be returned and execute.
After a while the page/cache will reset and the injection will no longer be returned. If an attacker continuously request the page with injections the page will assumably always respond with the injections though.
The text was updated successfully, but these errors were encountered: