Closed
Bug 915065
(csp-report-uri-tests)
Opened 12 years ago
Closed 11 years ago
Improve Content Security Policy tests to contain and check json report objects
Categories
(Core :: DOM: Security, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: freddy, Unassigned)
References
(Blocks 1 open bug)
Details
It looks like we have very little tests for CSP. Tests could be implemented in several ways, there are currently devtoosl test that check whether a violation message is being emitted. A good test would probably check that
- the blocked resource is not being loaded / script is not executed
- a meaningful message is logged to the web console
- a spec-compliant report is sent
We might write a lot of tests, e.g. for each directive, for each possibility to create execute JavaScript from strings etc. If we test for a sane report in each of those cases, we can avoid having to write a big report test and update it regularly.
Comment 1•12 years ago
|
||
Could you explain how this is related to Lightning extension? Or did you choose the wrong product?
| Reporter | ||
Comment 2•12 years ago
|
||
Core, not Calendar of course. Sorry for the noise!
Product: Calendar → Core
| Reporter | ||
Comment 3•12 years ago
|
||
It took me a while to understand (and find) the actual set of CSP tests. The state is not as bad as I thought, sorry.
But currently, none of the tests check for the report object being OK...
| Reporter | ||
Comment 4•12 years ago
|
||
It looks like I should find a way to update all existing tests to contain some sort of expected report and check if they match (for each).
On top, we would also need a generic report test that checks for policy-independent behavior (cookies, redirects, parameters being stripped off of the 'blocked-uri' part, etc.)
| Reporter | ||
Updated•12 years ago
|
Alias: csp-tests → csp-report-uri-tests
Summary: Develop a set of tests for Content Security Policy → Improve Content Security Policy tests to contain and check json report objects
Updated•11 years ago
|
Component: Security → DOM: Security
Comment 5•11 years ago
|
||
Hey Frederik, we are triaging CSP bugs. I was wondering if this test is sufficient:
http://mxr.mozilla.org/mozilla-central/source/dom/base/test/csp/test_csp_report.html?force=1
or if you are looking for any additional test coverage, if so, please let us know.
Flags: needinfo?(fbraun)
| Reporter | ||
Comment 6•11 years ago
|
||
Thanks for bringing this up again.
I filed this because I saw a mismatch between our tests and the web platform tests that used to exist on <http://webappsec-test.info/web-platform-tests/csp/> (this link is now outdated!).
I think we can resolve this, given that we also have the web-platform-tests in tree now as well.
Bug 607067, Bug 879316 and Bug 108465 also changed CSP tests and reporting.
Status: NEW → RESOLVED
Closed: 11 years ago
Flags: needinfo?(fbraun)
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•