-
Notifications
You must be signed in to change notification settings - Fork 150
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 reports for eval() and inline script are identical #52
Comments
Well, that's easy: you should allow neither. :) Point taken, though. Would you be willing to relay this suggestion to [email protected]? |
Also, while we fix this properly, you might find it useful right now to use script-src * 'unsafe-eval' and script-src * 'unsafe-inline' in two separate report-only headers for getting this telemetry. |
@devd This might be an option if you're fine-tuning a single website's policy, but I'm trying to do this on larger scale on http://cspbuilder.info/ so the CSP report processing is fully automatic. I'm currently working around the report identity problem by a simple heuristic - if the policy had |
I highly support this. A blank blocked-uri is nothing short of confusing. I don't think it should ever be blank but I digress. |
This problem is actually even more visible as eval-like functions are going mainstream in Cascading Style-Sheets, so "empty blocked-uri" reports can be now generated by 4 classes of events. |
I don't follow. What eval is going into CSS? Could you elaborate all four classes? |
Instances of CSS dynamic computations (like
While you can obviously distinguish between Actually, I've seen
Not sure how to interpret this one, but I've seen quite a lot of them. |
Not to derail the current conversation...
And event handlers and |
CSP violation reports sent when browser blocks
eval()
and inline script are identical in their contents, which makes it difficult to determine what really caused them.In both cases the fields
violated-directive
will be set toscript-scr
andblocked-uri
will be empty. So when I'm trying to analyse received reports I can't really say what I should allow -unsafe-eval
orunsafe-inline
.The solution might be either sending some kind of generic
blocked-url
value - such asself-eval
orself-inline
, or adding an additional field to the report, such asblocked-feature
set toeval
orinline
respectively.The text was updated successfully, but these errors were encountered: