diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-01 14:10:57 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2019-03-01 14:12:02 +0100 |
commit | e64dae886b83c63931c2f608c756885c689aeb56 (patch) | |
tree | dd2502a462e73fdc4941dce6925ea31f96ab8fef /application/basilisk | |
parent | f89a809df5e50fc4f7a58fcaac55861aa33a8e31 (diff) | |
parent | c1ece93c2be6fb571a013f9735dc629d7279f389 (diff) | |
download | UXP-e64dae886b83c63931c2f608c756885c689aeb56.tar UXP-e64dae886b83c63931c2f608c756885c689aeb56.tar.gz UXP-e64dae886b83c63931c2f608c756885c689aeb56.tar.lz UXP-e64dae886b83c63931c2f608c756885c689aeb56.tar.xz UXP-e64dae886b83c63931c2f608c756885c689aeb56.zip |
Improve the http basic auth DOS protection heuristics.
-> Merge branch 'authprompt-work'
Diffstat (limited to 'application/basilisk')
-rw-r--r-- | application/basilisk/app/profile/basilisk.js | 8 | ||||
-rw-r--r-- | application/basilisk/base/content/browser.js | 5 | ||||
-rw-r--r-- | application/basilisk/base/content/browser.xul | 3 | ||||
-rw-r--r-- | application/basilisk/base/content/tabbrowser.xml | 11 | ||||
-rw-r--r-- | application/basilisk/base/content/urlbarBindings.xml | 3 |
5 files changed, 27 insertions, 3 deletions
diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index 79d767851..24f1c582c 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -1438,3 +1438,11 @@ pref("browser.crashReports.unsubmittedCheck.autoSubmit2", false); // controlling validation are located in /services/sync/services-sync.js pref("services.sync.validation.enabled", true); #endif + +// When a user cancels this number of authentication dialogs coming from +// a single web page (eTLD+1) in a row, all following authentication dialogs +// will be blocked (automatically canceled) for that page. +// This counter is per-tab and per-domain to minimize false positives. +// The counter resets when the page is reloaded from the UI +// (content-reloads do NOT clear this to mitigate reloading tricks). +pref("prompts.authentication_dialog_abuse_limit", 3); diff --git a/application/basilisk/base/content/browser.js b/application/basilisk/base/content/browser.js index 9fb997a42..336670fa0 100644 --- a/application/basilisk/base/content/browser.js +++ b/application/basilisk/base/content/browser.js @@ -3094,6 +3094,11 @@ function getWebNavigation() } function BrowserReloadWithFlags(reloadFlags) { + + // Reset DOS mitigation for auth prompts when user initiates a reload. + let browser = gBrowser.selectedBrowser; + delete browser.authPromptCounter; + let url = gBrowser.currentURI.spec; if (gBrowser.updateBrowserRemotenessByURL(gBrowser.selectedBrowser, url)) { // If the remoteness has changed, the new browser doesn't have any diff --git a/application/basilisk/base/content/browser.xul b/application/basilisk/base/content/browser.xul index 3208538c1..be64f1bac 100644 --- a/application/basilisk/base/content/browser.xul +++ b/application/basilisk/base/content/browser.xul @@ -997,7 +997,8 @@ contentcontextmenu="contentAreaContextMenu" autocompletepopup="PopupAutoComplete" selectmenulist="ContentSelectDropdown" - datetimepicker="DateTimePickerPanel"/> + datetimepicker="DateTimePickerPanel" + authdosprotected="true" /> </vbox> <vbox id="browser-border-end" hidden="true" layer="true"/> </hbox> diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index 043838020..52c51db69 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -25,7 +25,7 @@ <xul:vbox flex="1" class="browserContainer"> <xul:stack flex="1" class="browserStack" anonid="browserStack"> <xul:browser anonid="initialBrowser" type="content-primary" message="true" messagemanagergroup="browsers" - xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker"/> + xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autocompletepopup,selectmenulist,datetimepicker,authdosprotected"/> </xul:stack> </xul:vbox> </xul:hbox> @@ -1936,6 +1936,10 @@ if (this.hasAttribute("datetimepicker")) { b.setAttribute("datetimepicker", this.getAttribute("datetimepicker")); } + + if (this.hasAttribute("authdosprotected")) { + b.setAttribute("authdosprotected", this.getAttribute("authdosprotected")); + } b.setAttribute("autoscrollpopup", this._autoScrollPopup.id); @@ -2991,7 +2995,10 @@ <parameter name="aTab"/> <body> <![CDATA[ - this.getBrowserForTab(aTab).reload(); + let browser = this.getBrowserForTab(aTab); + // Reset DOS mitigation for basic auth prompt + delete browser.authPromptCounter; + browser.reload(); ]]> </body> </method> diff --git a/application/basilisk/base/content/urlbarBindings.xml b/application/basilisk/base/content/urlbarBindings.xml index ad11f7fdf..b9c17818a 100644 --- a/application/basilisk/base/content/urlbarBindings.xml +++ b/application/basilisk/base/content/urlbarBindings.xml @@ -540,6 +540,9 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/. Cu.reportError(ex); } + // Reset DOS mitigations for the basic auth prompt. + delete browser.authPromptCounter; + let params = { postData, allowThirdPartyFixup: true, |