Commit Graph
199 Commits
Author SHA1 Message Date
Boris Zbarsky 89980d90cb Bug 1603806. Add a blocking reason when loads with the SEC_REQUIRE_SAME_ORIGIN_* security flags are blocked due to not being same-origin. r=ckerschb,ochameau
Differential Revision: https://phabricator.services.mozilla.com/D57147
2019-12-16 09:36:45 +00:00
Boris Zbarsky 8f97398a08 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 16:41:19 +00:00
Boris Zbarsky fcb04b87e4 Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID.  This allows us to report
errors from it to the web console as needed.  Most consumers know statically
whether they want reporting or not, so there's no reason to force the ones that
don't to provide window ids.

Differential Revision: https://phabricator.services.mozilla.com/D56388
2019-12-13 06:24:12 +00:00
Ciure Andrei 2e0157c747 Backed out 4 changesets (bug 1602483, bug 1602090) for causing perma leackchecks CLOSED TREE
Backed out changeset 6b057ba06b4a (bug 1602483)
Backed out changeset 9be3269d781d (bug 1602483)
Backed out changeset e3e2c1d7478e (bug 1602090)
Backed out changeset fdc4a588912e (bug 1602090)
2019-12-12 18:37:01 +02:00
Boris Zbarsky f99de7f9a0 Bug 1602483 part 2. Add a window id argument to CheckLoadURIWithPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D56428
2019-12-12 13:05:12 +00:00
Boris Zbarsky d9b66ffabd Bug 1602090 part 2. Create separate CheckMayLoad and CheckMayLoadWithReporting APIs. r=ckerschb
CheckMayLoadAndReport takes a window ID.  This allows us to report
errors from it to the web console as needed.  Most consumers know statically
whether they want reporting or not, so there's no reason to force the ones that
don't to provide window ids.

Differential Revision: https://phabricator.services.mozilla.com/D56388
2019-12-12 13:03:42 +00:00
Boris Zbarsky 33b5758e6f Bug 1601377 part 1. Make it clear that nsContentUtils::PrincipalAllowsL10n never takes a null nsIPrincipal. r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D56216
2019-12-09 15:10:32 +00:00
Gabriele Svelto eb403b8785 Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442
2019-12-06 09:24:56 +00:00
Sebastian Streich 5dbfc609f3 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830
2019-12-05 16:04:53 +00:00
Boris Zbarsky 2df1df0176 Bug 1517588. Use nsIPrincipal::IsSystemPrincipal instead of nsContentUtils::IsSystemPrincipal r=bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D53067
2019-12-05 04:44:32 +00:00
Dorel Luca 67889e1013 Backed out changeset f6e53d1c6518 (bug 1600545) for Android build bustage. CLOSED TREE 2019-12-04 17:32:27 +02:00
Gabriele Svelto dc6fa2e86c Bug 1600545 - Remove useless inclusions of header files generated from IDL files in dom/ r=Ehsan
The inclusions were removed with the following very crude script and the
resulting breakage was fixed up by hand. The manual fixups did either
revert the changes done by the script, replace a generic header with a more
specific one or replace a header with a forward declaration.

find . -name "*.idl" | grep -v web-platform | grep -v third_party | while read path; do
    interfaces=$(grep "^\(class\|interface\).*:.*" "$path" | cut -d' ' -f2)
    if [ -n "$interfaces" ]; then
        if [[ "$interfaces" == *$'\n'* ]]; then
          regexp="\("
          for i in $interfaces; do regexp="$regexp$i\|"; done
          regexp="${regexp%%\\\|}\)"
        else
          regexp="$interfaces"
        fi
        interface=$(basename "$path")
        rg -l "#include.*${interface%%.idl}.h" . | while read path2; do
            hits=$(grep -v "#include.*${interface%%.idl}.h" "$path2" | grep -c "$regexp" )
            if [ $hits -eq 0 ]; then
                echo "Removing ${interface} from ${path2}"
                grep -v "#include.*${interface%%.idl}.h" "$path2" > "$path2".tmp
                mv -f "$path2".tmp "$path2"
            fi
        done
    fi
done

Differential Revision: https://phabricator.services.mozilla.com/D55442
2019-12-04 15:01:19 +00:00
Frederik Braun 6d8a652d4b Bug 1543579 - Disallow SystemPrincipal for Remote documents on all channels r=ckerschb,tjr
Differential Revision: https://phabricator.services.mozilla.com/D54091
2019-12-02 10:45:23 +00:00
shindli 145f206006 Backed out changeset 68ff34ec8e96 (bug 1597704) for causing perma bc3 failures in browser/extensions/formautofill/test/browser/browser_autocomplete_footer.js CLOSED TREE 2019-11-28 16:12:45 +02:00
Sebastian Streich f5a4e64086 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830
2019-11-28 12:44:29 +00:00
Gurzau Raul e891894ac4 Backed out changeset 74162d71ef4d (bug 1597704) for failing at browser_insecurePasswordConsoleWarning.js on a CLOSED TREE. 2019-11-26 19:30:19 +02:00
Sebastian Streich ca5005b525 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830
2019-11-26 16:00:49 +00:00
Razvan Maries 2448b42ebe Backed out changeset 4082b974a1e6 (bug 1597704) test_isOriginPotentiallyTrustworthy.js. CLOSED TREE 2019-11-22 13:35:36 +02:00
Sebastian Streich f78e4e23b5 Bug 1597704 - Move is OriginPotentially Trustworthy into Principal r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D53830
2019-11-21 16:29:13 +00:00
Matt Woodrow 573ec12204 Bug 1594166 - Dont do nsContentSecurityManager checks for internal redirects. r=baku,ckerschb
We fail this during test_invalid_mime_type_blob.html when using DocumentChannel for blobs without this.
DocumentChannelChild reports an internal redirect as it replaces itself with the real channel (BlobURLChannel), and we fail the CheckLoadURIWithPrincipal checks.

The old channel has a null principal (due to being a sandboxed iframe), and we compare that to the blob principal computed from the URI, which is a normal content principal.

Differential Revision: https://phabricator.services.mozilla.com/D51905
2019-11-07 19:13:59 +00:00
Sebastian Streich 1dde6045df Bug 1585664 - Add GetAsciiSpecForLogging and update callers r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D47909
2019-10-22 16:03:27 +00:00
Alex Catarineu 541fdfc4a1 Bug 1573276 - Always allow localization in error pages r=johannh,peterv
Differential Revision: https://phabricator.services.mozilla.com/D43216
2019-09-25 10:39:45 +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
Tom Ritter 4601bc3af7 Bug 1578529 - Remove an Eval-Assert exception we don't need and accidently included r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D44527
2019-09-04 11:51:59 +00:00
Tom Ritter 5cdc9a1995 Bug 1573622 - Do not enforce eval() assertions if userchrome.css is enabled r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D41814
2019-08-14 14:29:57 +00:00
Jan Andre Ikenmeyer 014f0ed495 Bug 1560699 - Download FTP resources instead of rendering them. r=michal
Differential Revision: https://phabricator.services.mozilla.com/D39702
2019-08-11 20:46:06 +00:00
Christoph Kerschbaumer b30b653283 Bug 1573134: Inline evalAllowList within AssertEvalNotRestricted. r=jkt
Differential Revision: https://phabricator.services.mozilla.com/D41529
2019-08-13 11:59:11 +00:00
Kannan Vijayan c110dbe443 Bug 1569262 - Rename nsIDocShellTreeItem::GetRootTreeItem to GetInProcessRootTreeItem for Fission marking. r=nika
Differential Revision: https://phabricator.services.mozilla.com/D41064
2019-08-07 19:24:00 +00:00
Tom Ritter 932b5ba405 Bug 1572153 - Fix recording of Telemetry Events for Eval Usage r=chutten
Differential Revision: https://phabricator.services.mozilla.com/D41045
2019-08-07 16:55:22 +00:00
Tom Ritter bd67c7de9b Bug 1570738 - Record Telemetry if eval() is used in the Parent Process r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D40332
2019-08-06 19:56:23 +00:00
Emilio Cobos Álvarez d27fc95b73 Bug 1499000 - Make CORS use the right security flags to check whether an URL can be loaded. r=ckerschb
This fixes at least part of the problem. Without this patch, some of the flags
may get lost, like the ALLOW_CHROME flag which controls whether stuff like
resource:// URLs can be loaded or not.

Differential Revision: https://phabricator.services.mozilla.com/D40633
2019-08-05 19:28:00 +00:00
Tom Ritter e3bc861be1 Bug 1567623 - Add Event Telemetry for cases where eval is triggered as System Principal r=chutten,bzbarsky,tcampbell
Differential Revision: https://phabricator.services.mozilla.com/D39559
2019-08-01 20:45:31 +00:00
Tom Ritter f009ce76fb Bug 1567623 - Update AssertEvalNotUsingSystemPrincipal and re-enable it r=ckerschb
We now correctly handle the following cases:
 - Thunderbird
 - the Browser Toolbox/Console
 - Two safe and common idioms
 - when general.config.filename is set and userChromeJS does shenanigans

We also change the function to only crash in Debug mode, and for Release channels
we report diagnostic information in a way that does not reveal user data.

Differential Revision: https://phabricator.services.mozilla.com/D39557
2019-08-01 20:45:01 +00:00
Tom Ritter 02d430ab8d Bug 1567623 - Rename whitelist to allowlist r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D39556
2019-08-01 20:44:42 +00:00
Tom Ritter 744817554a Bug 1567623 - Change doContentSecurityCheck logging from Debug to Verbose r=ckerschb
They are too frequent and too verbose to see any other logging statements.

Differential Revision: https://phabricator.services.mozilla.com/D39555
2019-08-01 20:44:38 +00:00
Tom Schuster 9631de8e9e Bug 1558915 - Use infallible nsIURI::SchemeIs in dom/security. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D39779
2019-07-30 07:23:18 +00:00
Jonas Allmann 864742f182 Bug 1498560 - Remove new Function from autocomplete.xml, r=mak
Differential Revision: https://phabricator.services.mozilla.com/D38041
2019-07-25 13:56:57 +00:00
Julian Descottes 4ee81b6e02 Bug 1550476 - Remove jsol.js from nsContentSecurityManager whitelist r=ckerschb
Depends on D38515

Differential Revision: https://phabricator.services.mozilla.com/D38621
2019-07-19 07:26:32 +00:00
Julian Descottes 26b0766ae7 Bug 1550471 - Remove jszip.js from nsContentSecurityManager whitelist r=ckerschb
Depends on D38517

Differential Revision: https://phabricator.services.mozilla.com/D38620
2019-07-19 07:26:54 +00:00
Julian Descottes 51f71288be Bug 1550463 - Remove lodash.js from nsContentSecurityManager whitelist r=ckerschb
Depends on D38516

Differential Revision: https://phabricator.services.mozilla.com/D38619
2019-07-19 07:27:11 +00:00
Julian Descottes ac14065c99 Bug 1550489 - Remove react-redux.js from nsContentSecurityManager whitelist r=ckerschb
Depends on D38513

Differential Revision: https://phabricator.services.mozilla.com/D38618
2019-07-19 07:27:44 +00:00
Julian Descottes 6ca43442e8 Bug 1550485 - Remove redux.js from nsContentSecurityManager whitlelist r=ckerschb
Depends on D38514

Differential Revision: https://phabricator.services.mozilla.com/D38617
2019-07-19 07:27:51 +00:00
Tom Ritter b3804d474c Bug 1564527 - Enable AssertEvalNotUsingSystemPrincipal on Nightly builds r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D37460
2019-07-18 18:22:06 +00:00
Jonas Allmann d2f0581cc5 Bug 1560915 - Hardcode minimal eval()-whitelist for test files into eval()-assertion, r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D37695
2019-07-17 12:21:29 +00:00
Frederik Braun 7ae906f3e5 Bug 1565988 - fix typo in comment referencing follow-up work r=Pike
Differential Revision: https://phabricator.services.mozilla.com/D38050
2019-07-15 10:16:28 +00:00
Razvan Maries 553910fda4 Backed out changeset 6e4d13741a0f (bug 1564527) for perma AddressSanitizer failures. CLOSED TREE 2019-07-13 02:05:25 +03:00
Tom Ritter ec41c998fd Bug 1564527 - Enable AssertEvalNotUsingSystemPrincipal on Nightly builds r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D37460
2019-07-11 08:46:18 +00:00
Jonathan Kingston 32524b62e2 Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35504
2019-07-08 16:37:45 +00:00
Alex Catarineu f1e25269a5 Bug 467035 - Avoid leaking browser language via DTD r=Gijs,bzbarsky
Differential Revision: https://phabricator.services.mozilla.com/D34187
2019-07-08 10:47:05 +00:00
Frederik Braun 049e11fa77 Bug 1558745 - allow fxa to be loaded from systemprincipal (and then downgrade to content) r=ckerschb
Differential Revision: https://phabricator.services.mozilla.com/D35770
2019-07-03 13:59:28 +00:00