Closed Bug 1530602 Opened 7 years ago Closed 7 years ago

When tapping on "Custom Action..." the screen goes blank (EvalError: "call to Function() blocked by CSP")

Categories

(Tree Management :: Treeherder, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

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.

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.

Assignee: nobody → emorley
Blocks: 1270157
Status: NEW → ASSIGNED
Component: Treeherder → Treeherder: Job Triggering & Cancellation
Priority: -- → P1
Summary: When tapping on "Custom Action..." the screen goes blank → When tapping on "Custom Action..." the screen goes blank (EvalError: "call to Function() blocked by CSP")
Blocks: 1530607

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.

Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Component: Treeherder: Job Triggering & Cancellation → TreeHerder
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: