Closed
Bug 699586
Opened 13 years ago
Closed 12 years ago
Bug in Content Security Policy for setInterval and setTimeout when argument is a function
Categories
(Firefox :: Security, defect)
Tracking
()
RESOLVED
WORKSFORME
People
(Reporter: erlend, Assigned: bsterne)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
374 bytes,
text/php
|
Details |
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.15 Safari/535.7
Steps to reproduce:
I built a Content Security Policy readiness sheet: http://erlend.oftedal.no/blog/csp/readiness/version2.php
One of the tests are testing setTimeout(function, time) and setInterval(function, time)
Actual results:
The functions were blocked even though the argument is a function and is not creating code from strings like setInterval(String, time) and setTimeout(String, time).
Expected results:
These functions should not be blocked by the CSP directive for not allowing code to be generated from strings, as a function, not a string, is supplied. This works as expected in Chrome.
Assignee | ||
Updated•13 years ago
|
Assignee: nobody → bsterne
Reporter | ||
Comment 1•13 years ago
|
||
This still seems broken even in FF13.
Updated•12 years ago
|
Blocks: csp-w3c-1.0
Comment 2•12 years ago
|
||
Comment 3•12 years ago
|
||
I noticed the tests in comment 0 use 'unsafe-inline', but use the X- header (which is old CSP syntax and doesn't support the 'unsafe-inline' syntax).
In firefox 24a1 (nightly) I tested the X- header with inline scripts allowed (eval blocked) and indeed the eval of a string is blocked but setTimeout with a function is allowed. Tested the same thing with a CSP 1.0-compatible header:
Content-Security-Policy: default-src 'self'; script-src 'unsafe-inline'; style-src 'unsafe-inline' 'self'
And those tests passed too.
Perhaps the tests are testing the wrong syntax? Marking this as WFM since I can't reproduce the blocking-function-args problem.
Status: UNCONFIRMED → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
You need to log in
before you can comment on or make changes to this bug.
Description
•