Closed Bug 1649228 Opened 5 years ago Closed 5 years ago

Crash in mozilla::dom::ContentChild::RecvNotifyAlertsObserver caused by bug 1642991

Categories

(Core :: XPCOM, defect)

defect

Tracking

()

VERIFIED FIXED
mozilla80
Tracking Status
firefox-esr68 --- unaffected
firefox-esr78 --- unaffected
firefox77 --- unaffected
firefox78 --- unaffected
firefox79 + verified
firefox80 + verified

People

(Reporter: emilio, Assigned: emilio)

References

(Regression)

Details

(Keywords: csectype-uaf, regression, sec-high, Whiteboard: [sec-survey][post-critsmash-triage])

Attachments

(3 files)

Sebastian Simon helpfully came up with the STR for a crash in bug 1427459, which is a recent regression introduced in bug 1642991.

It is a pre-existing bug in RemoveElementsBy.

Hmm, maybe my diagnostic is wrong, let me build without optimizations to double-check me.

Flags: needinfo?(emilio)
Attached file Test-case

Looks like an UAF. :(

Group: core-security
Attached file ASAN log
Flags: needinfo?(emilio) → needinfo?(dveditz)

This probably had logic issues before bug 1642991, but not security
issues (at worst, an array out of bounds which is a release assertion
that would crash the process in a safe way).

Comment on attachment 9160187 [details]
Bug 1649228 - Fix ContentChild::RecvNotifyAlertsObserver to notify after, not while, removing observers from the vector. r=froydnj,smaug

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Relatively easy, the patch is very obvious.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Unknown
  • Which older supported branches are affected by this flaw?: beta
  • If not all supported branches, which bug introduced the flaw?: Bug 1642991
  • Do you have backports for the affected branches?: Yes, applies cleanly on beta
  • If not, how different, hard to create, and risky will they be?:
  • How likely is this patch to cause regressions; how much testing does it need?: Not likely at all. It's more correct than the code that used to be before bug 1642991.
Attachment #9160187 - Flags: sec-approval?
Group: core-security → dom-core-security
Flags: needinfo?(dveditz)

(In reply to Emilio Cobos Álvarez (:emilio) from comment #7)

  • Which older supported branches are affected by this flaw?: none, nightly-only
  • If not all supported branches, which bug introduced the flaw?: Bug 1642991

I think the merge already happened. The bug is effectively on Beta now and we'll need to uplift the patch.

Ah, true... I edited the form.

See Also: → 1649770

The assertion suggested to be added in Bug 1649770 would probably have caught this earlier on.

Comment on attachment 9160187 [details]
Bug 1649228 - Fix ContentChild::RecvNotifyAlertsObserver to notify after, not while, removing observers from the vector. r=froydnj,smaug

Approved to land and uplift

Attachment #9160187 - Flags: sec-approval?
Attachment #9160187 - Flags: sec-approval+
Attachment #9160187 - Flags: approval-mozilla-beta+
Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla80

As part of a security bug pattern analysis, we are requesting your help with a high level analysis of this bug. It is our hope to develop static analysis (or potentially runtime/dynamic analysis) in the future to identify classes of bugs.

Please visit this google form to reply.

Flags: needinfo?(emilio)
Whiteboard: [sec-survey]

done

Flags: needinfo?(emilio)
Flags: qe-verify+
Whiteboard: [sec-survey] → [sec-survey][post-critsmash-triage]

I've reproduced this crash using an affected Nightly asan build from 2020-07-02, and by loading into the browser the test case from comment 2.

The crash is verified as fixed on the latest asan builds, Nightly 80.0a1 and Beta 79.0b9, running Ubuntu 18.04 x64.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
Group: core-security-release
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: