-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
fix(toolbar): Tighten up iframe security and fix bug when saving cookie #79885
Conversation
Currently, when trying to save a cookie in the iframe we throw an exception as there's a reference to `cookie` where it should be `data.cookie`. On top of this the iframe has 2 security issues 1. It would establish the messaging channel even if stat is not success once the login form succeeds. This opens up the possibility to make API requests on behalf of the user from an authorized parent page. This is especially doable through click-jacking as one can position an almost invisible iframe, make users click the login button to trigger the issue. 2. The valid functions check uses a naive `in` operator which allows outsiders access to built-in properties and methods such as `__proto__` and `__defineGetter__` etc, allowing an attacker to inject their own functions and code. This patch fixes both issues. There remains one last issue where in `fetch` we accept any URL and don't check it, allowing an outsider/attacker to initiate fetch requests to any domain from sentry.io. We should address this soon but I think it is lower impact compared to the other two above.
❌ 1 Tests Failed:
View the full list of 1 ❄️ flaky tests
To view individual test run time comparison to the main branch, go to the Test Analytics Dashboard |
This issue has gone three weeks without activity. In another week, I will close it. But! If you comment or otherwise update it, I will reset the clock, and if you remove the label "A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀 |
@ryan953 @mdtro @getsentry/security - Closed this PR as it got out of date and seems like there's a lack of interest. That said there are still 2 important issues with the
Combining these, it looks like anyone can load this page, send a |
Currently, when trying to save a cookie in the iframe we throw an exception as there's a reference to
cookie
where it should bedata.cookie
. On top of this the iframe has 2 security issuesin
operator which allows outsiders access to built-in properties and methods such as__proto__
and__defineGetter__
etc, allowing an attacker to inject their own functions and code.This patch fixes both issues. There remains one last issue where in
fetch
we accept any URL and don't check it, allowing an outsider/attacker to initiate fetch requests to any domain from sentry.io. We should address this soon but I think it is lower impact compared to the other two above.