Closed Bug 1550485 Opened 6 years ago Closed 5 years ago

Usage of `new Function()` in third-party library redux.js

Categories

(Core :: DOM: Security, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jallmann, Assigned: jdescottes)

References

(Blocks 1 open bug)

Details

(Whiteboard: [domsecurity-backlog1])

Attachments

(2 files)

All eval()-like functions (eval(), new Function(), setTimeout("")) are being removed from code running with system privileges, see Bug 1473549. An assertion is active to enforce this.

There are two occurences of new Function() in redux.js that require the file to be whitelisted for this assertion. In order to clear redux.js from the whitelist, new Function() needs to be removed or refactored. In both cases, new Function()is used to get the global object. This can poissibly be avoided by just removing the code like it was done in reudx.jsm, see Bug 1486375.

Get global object:
https://searchfox.org/mozilla-central/source/devtools/client/shared/vendor/redux.js#18

Get global object:
https://searchfox.org/mozilla-central/source/devtools/client/shared/vendor/redux.js#242

Summary: Usage of `eval()` in third-party library redux.js → Usage of `new Function()` in third-party library redux.js
Assignee: nobody → jdescottes
Status: NEW → ASSIGNED

Depends on D38513

Pushed by jdescottes@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/dbe62a4f2b41 Remove usage of new Function in redux.js r=nchevobbe https://hg.mozilla.org/integration/autoland/rev/c48fcf3a6532 Remove redux.js from nsContentSecurityManager whitlelist r=ckerschb
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: