When tapping on "Custom Action..." the screen goes blank (EvalError: "call to Function() blocked by CSP")
Categories
(Tree Management :: Treeherder, defect, P1)
Tracking
(Not tracked)
People
(Reporter: cbrindusan, Assigned: emorley)
References
(Blocks 1 open bug)
Details
Attachments
(2 files)
To repro this issue, login, tap on a job and choose "Custom Action..." and observe how the screen goes blank.
After refresh, the page goes back to normal.
| Reporter | ||
Comment 1•7 years ago
|
||
| Assignee | ||
Comment 2•7 years ago
•
|
||
In the browser console I see:
Error compiling schema, function code: ...
Followed by:
EvalError: "call to Function() blocked by CSP"
This is due to bug 1270157.
Unfortunately it looks like ajv requires unsafe-eval, yuck. This did show up in New Relic insights, however looked similar to the violations from junk scripts browser extensions inject in the page.
Comment 3•7 years ago
|
||
| Assignee | ||
Comment 5•7 years ago
|
||
Temporarily added 'unsafe-eval' to CSP script-src so that ajv.compile() works:
https://github.com/mozilla/treeherder/commit/5986749757406552f2ce088e70bee878ad001088
Deploying now, should be live in the next couple of minutes. Sorry for the breakage.
I really wish Firefox's error reporting for CSP violations were better - at the moment violations from browser addons injecting scripts (eg LastPass or Adblock) look just like real usages of eval() or similar, so hard to tell them apart.
Bug 1530607 is filed for figuring our how to stop using ajv, so we can remove this use of 'unsafe-eval' again - given that it somewhat defeats the point of using CSP.
Updated•4 years ago
|
Description
•