Closed Bug 1720926 (CVE-2021-43545) Opened 3 years ago Closed 3 years ago

Location API rate limit code does not cover location.reload

Categories

(Core :: DOM: Navigation, defect)

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox-esr78 --- wontfix
firefox-esr91 95+ fixed
firefox93 --- wontfix
firefox94 --- wontfix
firefox95 + fixed

People

(Reporter: pbz, Assigned: pbz)

References

Details

(Keywords: csectype-dos, hang, sec-low, Whiteboard: [post-critsmash-triage][adv-main95+][adv-ESR91.4.0+])

Attachments

(2 files)

Calls to location.reload() are not rate limited and thus can be used to DoS the parent process.
While testing on Ubuntu this also caused Firefox to exhaust my RAM and caused the desktop environment to get slower, freeze and finally crash.

while(true) location.reload();

Marking this a sec-bug for now, because Bug 1314912 was.

Group: core-security → dom-core-security

Hey, Paul, will you be able to help add rate limits for this API?

Severity: -- → S2
Flags: needinfo?(pbz)
Assignee: nobody → pbz
Status: NEW → ASSIGNED
Flags: needinfo?(pbz)

Landed: https://hg.mozilla.org/integration/autoland/rev/21276955f659026ff55e579d9ca37a284552e7b3

Backed out for causing hybrid (= non-unified) bustages on nsIPrincipal.
https://hg.mozilla.org/integration/autoland/rev/ee8efced380b871deac4fba285955953a4a89ef5

Push with failures: https://treeherder.mozilla.org/jobs?repo=autoland&group_state=expanded&resultStatus=usercancel%2Ctestfailed%2Cbusted%2Cexception%2Cretry&revision=21276955f659026ff55e579d9ca37a284552e7b3
Failure log: https://treeherder.mozilla.org/logviewer?job_id=355149278&repo=autoland

[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -  In file included from /builds/worker/workspace/obj-build/dist/include/nsIScriptSecurityManager.h:14:
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -  /builds/worker/workspace/obj-build/dist/include/nsIPrincipal.h(338,20): error: inline function 'nsIPrincipal::IsSystemPrincipal' is not defined [-Werror,-Wundefined-inline]
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -         inline bool IsSystemPrincipal() const;
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -                     ^
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -  /builds/worker/checkouts/gecko/dom/base/nsHistory.cpp(167,45): note: used here
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -    CallerType callerType = aSubjectPrincipal.IsSystemPrincipal()
[task 2021-10-18T12:48:01.196Z] 12:48:01     INFO -                                              ^
Flags: needinfo?(pbz)
Flags: needinfo?(pbz)
Group: dom-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]

Please nominate this for ESR91 approval when you get a chance.

Flags: needinfo?(pbz)

Comment on attachment 9246207 [details]
Bug 1720926 - Rate limit calls to location.reload. r=smaug!

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration:
  • User impact if declined: Sites can make repeated calls to location.reload() slowing down or freezing the browser, potentially causing OS stability issues. due to memory exhaustion. These DoS attacks are often used to trick users into calling scam hotlines.
  • Fix Landed on Version: 95
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): Small code change with automated test coverage which had bake time in Nightly and Beta. The underlying rate limiting mechanism has been deployed in Firefox for a long time and is well understood.
  • String or UUID changes made by this patch:
Flags: needinfo?(pbz)
Attachment #9246207 - Flags: approval-mozilla-esr91?

Comment on attachment 9246207 [details]
Bug 1720926 - Rate limit calls to location.reload. r=smaug!

Approved for 91.4esr.

Attachment #9246207 - Flags: approval-mozilla-esr91? → approval-mozilla-esr91+
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main95+][adv-ESR91.4.0+]
Attached file advisory.txt
Alias: CVE-2021-43545
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: