-
Notifications
You must be signed in to change notification settings - Fork 78
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
CSP Report Does Not Reflect Redirected Blocked Domains #672
Comments
This is unfortunately an intentional decision. Revealing information about redirect targets would absolutely help make debugging simpler, but it would also leak details about another origin's behavior that shouldn't be made accessible (consider redirections that include session IDs, usernames, etc). I don't think this is something we'll be able to easily change. |
At some point we should add a header that allows exposing the redirect: whatwg/fetch#601 Might well be one of the more popular Fetch requests at this point. (This would work for same-origin URLs that redirect or CORS cross-origin URLs that redirect if they opt in.) |
If Fetch makes this information safe to expose via an opt-in like the one discussed above, CSP could certainly rely upon it. In the absence of such an opt-in, I don't think there's anything CSP can/should do here. |
Can we only report the domain name after the redirection, so that we can append the domain name to the connect-src whitelist without disclosing the specific URL information |
The domain name itself is also confidential information. It might well include the name of the user based on a login cookie or some such. |
I don't understand why the domain name includes cookies and user name,If this is the case, can only report the second-level domain name? |
The domain name doesn't include cookies, but the request which redirected would have had access to those cookies, and might have chosen the destination domain based on those cookies. |
I wonder if it would be more useful for the report to not display the original URL but rather some placeholder like "[Cross origin redirect]" to at least not confuse those debugging. |
When requests on the website are redirected, the domain to which the request is redirected is blocked because it is not included in the connect-src whitelist. However, the CSP report shows the blockedURL as the original domain before the redirect. This makes it difficult to troubleshoot the issue. It would be helpful if the CSP report could include the actual domain that was blocked after the redirect, or better yet, include both the original and the redirected domains.
The text was updated successfully, but these errors were encountered: