-
Notifications
You must be signed in to change notification settings - Fork 144
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
Validator: No longer warns about CSP #1506
Comments
As far as I know we explicitly enabled them again since that matches current add-on policies. See https://github.com/mozilla/addons-linter/blob/master/tests/parsers/test.manifestjson.js#L423-L426 Also… to verify issues faster and give more proper responses it'd be wonderful if you could add a little bit more detail - e.g what rules weren't warned about but you expected them to etc. Closing as this is expected and not a bug. |
The issue should have been apparent by testing the link I gave in my report. Example addon: Validator: No mention of CSP manifest.json Issue Problem: I have my own scripts that picks up
I didn't understand. Is it expected to miss unsafe-eval in CSP in validator? |
As far as I know it's more that there are valid cases where it might make sense. Summoning @wagnerand |
I just re-read the pull request discussions. The reason, I asked for this (in #1434 (review)) was that That said, @erosman is probably right in that we might want to add a warning for |
Can you share more details on why unsafe-inline is unimportant? AIUI, if there is code that manages to inject DOM elements from a remote source, this could also be a script tag, which unsafe-inline will prevent. Sure, this may not be as common, but as the workaround is just making that script a separate file I don't see why we should relax this rule. |
https://developer.mozilla.org/en-US/Add-ons/WebExtensions/manifest.json/content_security_policy says that |
@wagnerand we don't have any way of saying that |
@EnTeQuAk I am inclined to say we just ignore Also, let me find out whether we plan on supporting it at some point. |
According to @kmaglione, we don't plan on supporting it. |
Another example
|
* Add CSP warning for unsafe-eval. Fixes #1506 * Add more detailed error message for unsafe-eval * Add missing rules.md entry
Verified this on AMO-dev FF55(Win 7). |
There used to be a warning about CSP, regardless of its content. Of course, that warning was not always needed since CSP in itself is not a problem. From what I understand, the validator was updated to only show a warning when CSP exists AND it contains The updated validator now misses the CSP altogether as shown in the examples. |
Doesn't seem right to me. The linter should raise a warning (respectively) for
So, the CSP |
Also, this works for me locally using the file from #1506 (comment).
@ValentinaPC Did you test on -dev? This isn't on -dev yet. |
I'll update the issue once this is on dev, I'll probably release a new version Monday morning. |
@EnTeQuAk : not yet on -dev? Thanks! |
Ah, I forgot this issue. It is now, got a release yesterday. It's on -dev and -stage. |
Yeah, I can confirm that. @EnTeQuAk do you have time to look into this? |
Also, when I use both options in the form: |
Mhmm, interesting. I'll look into it later today
On Wed, Sep 13, 2017, at 02:08 PM, ValentinaPC wrote:
Also, when I use both options in the form:
"content_security_policy": "script-src 'self' 'unsafe-eval'
https://example.com; object-src 'self'"> I receive 1 warning at validation and 2 warnings in the report page.> If I reverse the order and use the form:
"content_security_policy": "script-src 'self' https://example.com; 'unsafe-
eval' object-src 'self'"> I receive 1 warning validation and 1 warning in the report page
— You are receiving this because you were mentioned. Reply to this
email directly, view it on GitHub[1], or mute the thread[2].>
|
@ValentinaPC @wagnerand yeah, I can confirm that and it looks similar (or even a duplicate) to #1547 I'll use #1547 to track this and work on it there. |
Since the latest push, the validator no longer warns about CSP.
Example:
https://addons.mozilla.org/editors/review/850282/
The text was updated successfully, but these errors were encountered: