Open Bug 1396145 Opened 7 years ago Updated 2 years ago

Consider disabling eval/Function in BackstagePass scopes


(Core :: XPConnect, enhancement, P2)





(Reporter: kmag, Unassigned)


(Depends on 1 open bug)


(Keywords: sec-want)

One of the last sticking points for enabling shared globals for JSMs is that things like (0, eval)("this") and Function("return this") may behave inconsistently.

Ideally, we really shouldn't be using eval in chrome code at all, and there seems to be a pretty strong consensus that disabling it is the way to go.

Unfortunately, we also seem to have a surprising amount of existing code relying on it:

These are actually instances of the pattern we're trying to avoid, and can be fixed by adding some variables to the header of the script:

This one is probably safe, but also entirely unnecessary since it's just eval()ing static JSON-compatible data strings from an adjacent script:

Most of the remaining calls are in test files that we can either fix, or add exceptions for when running in automation.
See Also: → 1396050
Priority: -- → P2
No longer blocks: 1186409
Depends on: 1399997
No longer blocks: 1381961
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.