-
Notifications
You must be signed in to change notification settings - Fork 25
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
Giscus session ID may be leaked when discussion is created #8
Comments
# [v@giscus/react-v1.0.1](https://github.com/giscus/giscus-component/compare/@giscus/react-v1.0.0...@giscus/react-v1.0.1) (2021-11-14) ## 🔒 Security Issues - [`51fbb5b`](51fbb5b) (react) Update iframe src after deleting session param (Issues: [`#8`](#8))
🎉 This issue has been resolved in version @giscus/react-v1.0.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
@Maronato Thanks for the report, could you verify that the issue has been fixed in the latest release (v1.0.1)? |
From what I can tell, this update seems to have introduced some bugs:
Reverting back to |
@dfeng could you check with the latest version (v1.1.1)? It should fix the issue. |
looks like it's working! cheers :) |
When commenting/reacting on a page that doesn't have a discussion yet, the user's session ID is leaked in the page URL attached to the discussion.
This allows anyone to impersonate the user in the comments just by clicking the page URL provided in the discussion.
Reproducing
With Giscus installed on a website using a giscus component:
Giscus will create a new discussion and attach a link to the related page. The link will have the format:
https://<host>/<page>?giscus=<user-session-id>
Anyone that clicks this link, will be redirected to the page and logged into giscus using the leaked session id, therefore being able to comment and react as the user who created the discussion.
Possible cause
I haven't gone too deep into the code, but it seems to be caused by the use of
location.href
in the body of the discussion.location.href
also contains search parameters, so after the user returns from the oauth login flow with the session id in the URL, it is used as the page origin and included in the discussion.Notes
I faced this leak when using
@giscus/react
and possibly traced the issue back to this line.The script client does not seem to be vulnerable to this issue since it removes the parameter from the url.
The text was updated successfully, but these errors were encountered: