Commit Graph
38 Commits
Author SHA1 Message Date
Jeff Walden 5c07885dcf Bug 1602882 - Move array operations to a new js/Array.h header. r=sfink,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D56595
2019-12-11 06:17:44 +00:00
Tom Ritter c6028aa25b Bug 1582512 - Add in exception cases where we disable the javascript load restrictions r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53245
2019-12-03 04:52:49 +00:00
Tom Ritter de58d95dc9 Bug 1582512 - Record a Telemetry Event if we receive a request to load a script filename we aren't expecting r=chutten
While we're here, we also extend the collection period for evalUsage, as it is taking longer to deploy than expected.

Differential Revision: https://phabricator.services.mozilla.com/D53233
2019-12-02 17:27:16 +00:00
Tom Ritter c82377eb30 Bug 1582512 - Rename FilenameToEvalType to FilenameToFilenameType r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53232
2019-12-02 17:27:05 +00:00
Tom Ritter eae6e7bfec Bug 1582512 - Rename FilenameType to FilenameTypeAndDetails r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53231
2019-12-02 17:27:07 +00:00
Tom Ritter bf3a3cdefe Bug 1582512 - Register a ScriptValidationCallback to examine script loads in the parent process r=Gijs,ckerschb
Additionally, we disable validation on PAC scripts.

Differential Revision: https://phabricator.services.mozilla.com/D46500
2019-12-02 17:27:09 +00:00
Ciure Andrei a1ad095ff5 Backed out 10 changesets (bug 1582512) for causing browser_preferences_usage.js to permafail CLOSED TREE
Backed out changeset a615a2c07523 (bug 1582512)
Backed out changeset 7dd0266da0a1 (bug 1582512)
Backed out changeset dfdefc6ede97 (bug 1582512)
Backed out changeset 59db30e1915f (bug 1582512)
Backed out changeset 1eb6f6b02149 (bug 1582512)
Backed out changeset 391ed11326fb (bug 1582512)
Backed out changeset 02865605c1c3 (bug 1582512)
Backed out changeset 017582048986 (bug 1582512)
Backed out changeset 1374c08302f9 (bug 1582512)
Backed out changeset 40dd63b6910a (bug 1582512)
2019-12-02 19:23:12 +02:00
Tom Ritter 4991f1d4d2 Bug 1582512 - Add in exception cases where we disable the javascript load restrictions r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53245
2019-12-02 15:46:04 +00:00
Tom Ritter 7aa60c969a Bug 1582512 - Record a Telemetry Event if we receive a request to load a script filename we aren't expecting r=chutten
While we're here, we also extend the collection period for evalUsage, as it is taking longer to deploy than expected.

Differential Revision: https://phabricator.services.mozilla.com/D53233
2019-12-02 15:45:37 +00:00
Tom Ritter ba0439c42b Bug 1582512 - Rename FilenameToEvalType to FilenameToFilenameType r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53232
2019-12-02 15:45:27 +00:00
Tom Ritter e44651b4ce Bug 1582512 - Rename FilenameType to FilenameTypeAndDetails r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53231
2019-12-02 15:45:20 +00:00
Tom Ritter 75a8e6905f Bug 1582512 - Register a ScriptValidationCallback to examine script loads in the parent process r=Gijs,ckerschb
Additionally, we disable validation on PAC scripts.

Differential Revision: https://phabricator.services.mozilla.com/D46500
2019-12-02 15:45:13 +00:00
Cosmin Sabou d04c510db3 Backed out 11 changesets (bug 1582512) for causing valgrind bustages.
Backed out changeset 8b850fd66bf5 (bug 1582512)
Backed out changeset 07d3631e609a (bug 1582512)
Backed out changeset fa91b085eb59 (bug 1582512)
Backed out changeset 232d5735d404 (bug 1582512)
Backed out changeset 47045fa2ffd2 (bug 1582512)
Backed out changeset 40a0f6c6cd61 (bug 1582512)
Backed out changeset 5fb3e489c31f (bug 1582512)
Backed out changeset 379318a35b20 (bug 1582512)
Backed out changeset bf81985c33b7 (bug 1582512)
Backed out changeset 1e0dd57b8041 (bug 1582512)
Backed out changeset 2787043f1fab (bug 1582512)
2019-11-20 18:44:45 +02:00
Tom Ritter 39bf020747 Bug 1582512 - Fixup: correct filemode
Differential Revision: https://phabricator.services.mozilla.com/D53974
2019-11-20 16:11:58 +00:00
Tom Ritter 3a7eeb2411 Bug 1582512 - Add in exception cases where we disable the javascript load restrictions r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53245
2019-11-20 16:11:58 +00:00
Tom Ritter cb8d3b3cbc Bug 1582512 - Record a Telemetry Event if we receive a request to load a script filename we aren't expecting r=chutten
While we're here, we also extend the collection period for evalUsage, as it is taking longer to deploy than expected.

Differential Revision: https://phabricator.services.mozilla.com/D53233
2019-11-19 16:10:51 +00:00
Tom Ritter 366baaa2c9 Bug 1582512 - Rename FilenameToEvalType to FilenameToFilenameType r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53232
2019-11-18 20:44:56 +00:00
Tom Ritter 7a996cd293 Bug 1582512 - Rename FilenameType to FilenameTypeAndDetails r=Gijs,ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53231
2019-11-18 20:44:48 +00:00
Tom Ritter 7e95c6bfac Bug 1582512 - Register a ScriptValidationCallback to examine script loads in the parent process r=Gijs,ckerschb
Additionally, we disable validation on PAC scripts.

Differential Revision: https://phabricator.services.mozilla.com/D46500
2019-11-19 13:04:00 +00:00
Tom Ritter 3f525fb0ab Bug 1596421 - Disable eval restrictions if the web extension process is disabled r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53026
2019-11-15 15:36:42 +00:00
Tom Ritter e4e486ac4f Bug 1592321 - Collect a sanitized path for files doing eval() on Windows in the same manner as untrusted modules r=aklotz
Differential Revision: https://phabricator.services.mozilla.com/D50957
2019-11-11 15:39:21 +00:00
Tom Ritter 5bba7c286b Bug 1584602 - Enforce eval restrictions in Workers and do not enforce restrictions in Release r=ckerschb
This commit does two things. Firstly it enforces eval restrictions in Workers per Bug 1584602.
We're collecting telemetry on these in Beta (and not seeing any) so we can let enforcement ride up to Beta.

Secondly, it disables enforcement checks on Release (and late Beta, as explained in the comment) until
we can gather data about what's happening in Release. This is a counterpart to Bug 1592349 for -central.

We have two separate commits because the first part of this is a change in the same code and we'd have
rebase problems if we tried to do them both separately.

This does tie enforcement to a build-time constant instead of leaving it as a pref. This doesn't make
me very happy inside, but I don't think the extra complexity is worth it...

Differential Revision: https://phabricator.services.mozilla.com/D50970
2019-10-30 15:21:57 +00:00
Tom Ritter f29aff6138 Bug 1588816 - Remove userChrome.css case since XBL is dead in Nightly r=bgrins
Differential Revision: https://phabricator.services.mozilla.com/D50964
2019-10-29 17:10:59 +00:00
Christoph Kerschbaumer 8b97791532 Bug 1590784: Move GetHttpChannelHelper into nsContentSecurityUtils. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D50238
2019-10-23 15:17:21 +00:00
Christoph Kerschbaumer b5d9082dfb Bug 1587417: Add about:logo to allowlist of CSP assertion. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D48703
2019-10-09 13:33:15 +00:00
Tom Ritter 4c8f4ad9de Bug 1583949 - Add a check for IsEvalAllowed to the worker callpath for eval() r=ckerschb,baku
This patch does several things.  Because Workers aren't on the main thread,
many of the things done are in the name of off main thread access.

1) Changes a parameter in IsEvalAllowed from a nsIPrincipal to a bool.
   We only used the principal to determined if it was the System Principal.
   Principals aren't thread safe and can only be accessed on Main Thread, so
   if we passed a Principal in, we would be in error. Instead only pass in
   the bool which - for workers - comes from a thread-safe location.

2) Separates out the Telemetry Event Recording and sending a message to the
   console into a new function nsContentSecurityUtils::NotifyEvalUsage. (And
   creates a runnable that calls it.)

   We do this because we will need to only call this method on the main thread.

   Telemetry Event Recording has only ever been called on the Main Thread.
   While I possibly-successfully cut it over to happen Off Main Thread (OMT)
   by porting preferences to StaticPrefs, I don't know if there were other
   threading assumptions in the Telemetry Code. So it would be much safer to
   just continue recording Event Telemetry on the main thread.

   Sending a message to the console requires calling GetStringBundleService()
   which requires main thread. I didn't investigate if this could be made
   thread-safe, I just threw it onto the main thread too.

   If, in IsEvalAllowed, we are on the main thread - we call NotifyEvalUsage
   directly. If we are not, we create a runnable which will then call
   NotifyEvalUsage for us on the main thread.

3) Ports allow_eval_with_system_principal and allow_eval_in_parent_process
   from bools to RelaxedAtomicBool - because we now check these prefs OMT.

4) In RuntimeService.cpp, adds the call to IsEvalAllowed.

5) Add resource://gre/modules/workers/require.js to the allowlist of eval
   usage. This was the script that identified this gap in the first place.
   It uses eval (twice) for structural reasons (scope and line number
   massaging.)  The contents of the eval are the result of a request to a
   uri (which may be internal, like resource://). The whole point of this
   is to implement a CommonJS require() api.

   This usage of eval is safe because the only way an attacker can inject
   into it is by either controlling the response of the uri request or
   controlling (or appending to) the argument. If they can do that, they
   are able to inject script into Firefox even if we cut this usage of eval
   over to some other type of safe(r) script loader.

   Bug 1584564 tracks making sure calls to require.js are safe.

6) Adds cld-worker.js to the allowlist. Bug 1584605 is for refactoring that
   eval usage, which is decidedly non-trivial.

7) Does _not_ enforce the eval restrictions for workers. While I've gotten
   try to be green and not throw up any instances of eval-usage by workers,
   it is much safer to deploy this is Telemetry-only mode for Workers for
   a little bit to see if anything pops up from the Nightly population.

   Bug 1584602 is for enforcing the checks.

Differential Revision: https://phabricator.services.mozilla.com/D47480
2019-10-08 17:31:35 +00:00
Sylvestre Ledru 49802d0a8e Bug 1519636 - Reformat recent changes to the Google coding style r=Ehsan
# ignore-this-changeset

Differential Revision: https://phabricator.services.mozilla.com/D47737
2019-10-06 18:29:55 +00:00
Christoph Kerschbaumer 6f46d5f9ff Bug 1583489: TIghten CSP assertion for about: pages. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D47423
2019-09-27 12:33:27 +00:00
Christoph Kerschbaumer 6dec8a1a75 Bug 1499354: Add object-src 'none' to the CSP of all about: pages. r=freddyb
Differential Revision: https://phabricator.services.mozilla.com/D46950
2019-09-26 16:22:41 +00:00
Christoph Kerschbaumer eb135ed7e0 Bug 1497200: Apply Meta CSP to about:downloads. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D45330
2019-09-25 13:50:28 +00:00
Tom Ritter 7c848e1ae3 Bug 1570681 - Enforce eval restrictions in system contexts and the parent process r=ckerschb
We log to MOZ_LOG, report an error to the console, send telemetry, and in debug builds - crash

Differential Revision: https://phabricator.services.mozilla.com/D45055
2019-09-19 02:32:41 +00:00
Tom Ritter 9edca4a7d2 Bug 1570681 - Move Eval testing logic from nsContentSecurityManager to nsContentSecurityUtils r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D45484
2019-09-18 19:36:31 +00:00
Christoph Kerschbaumer e3b867f664 Bug 1566386: Assert that every about: page on Android ships with a CSP. r=snorp
Differential Revision: https://phabricator.services.mozilla.com/D45193
2019-09-10 06:26:14 +00:00
Christoph Kerschbaumer b8ecc274c0 Bug 1497584: Apply Meta CSP to about:preferences. r=Gijs
Differential Revision: https://phabricator.services.mozilla.com/D44474
2019-09-06 11:59:19 +00:00
Christoph Kerschbaumer 0e5adcb7d2 Bug 1578231: Hardcode whitelist of about: pages where we can not apply a CSP. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D44617
2019-09-05 14:22:09 +00:00
Dorel Luca ea83edc5b5 Backed out changeset e2927c8227d9 (bug 1578231) for Browser-chrome failures browser/base/content/test/performance/browser_preferences_usage.js 2019-09-05 14:47:53 +03:00
Christoph Kerschbaumer 4faa71ff31 Bug 1578231: Hardcode whitelist of about: pages where we can not apply a CSP. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D44617
2019-09-05 09:44:13 +00:00
Christoph Kerschbaumer a33b5c6fcf Bug 1573145: Create ContentSecurityUtils.h/cpp and move AssertAboutPageHasCSP into it. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D41537
2019-08-14 10:15:09 +00:00