Closed Bug 1748210 Opened 3 years ago Closed 3 years ago

Hit MOZ_CRASH(nsSupportsPRUint32 not thread-safe) at xpcom/base/nsISupportsImpl.cpp:43

Categories

(Core :: Networking: HTTP, defect, P2)

x86_64
Linux
defect

Tracking

()

RESOLVED FIXED
98 Branch
Tracking Status
firefox-esr91 97+ fixed
firefox96 --- wontfix
firefox97 + fixed
firefox98 + fixed

People

(Reporter: decoder, Assigned: kershaw)

References

Details

(4 keywords, Whiteboard: [post-critsmash-triage][adv-main97+r][sec-survey][adv-esr91.6+r])

Attachments

(3 files)

The attached testcase crashes on mozilla-central revision 20211231-d0a94b1f309b (fuzzing build required).

For detailed crash information, see attachment.

I was not able to reproduce this issue so far, but it reproduces fairly often in our fuzzing infra. I guess this is a data race of some sort, but I also tried a TSan build with no luck. Maybe the stack is enough to figure out what is going on.

Normally, the issue would be reproducible with the following steps:

  1. Download the attached testcase, save as "test.bin".
    2a. Build with --enable-fuzzing (requires Clang and ASan, also build gtests using ./mach gtest dontruntests).
    2b. Alternatively you can download builds from TC using python -mfuzzfetch -a --fuzzing --gtest (see https://github.com/MozillaSecurity/fuzzfetch).
  2. Run FUZZER=NetworkHttpProxyPlain objdir/dist/bin/firefox test.bin

Marking s-s until investigated.

(Missing testcase for comment 0).

Attached file Testcase for comment 4
Assignee: nobody → kershaw
Status: NEW → ASSIGNED
Priority: -- → P2
Whiteboard: [necko-triaged]
Group: core-security → network-core-security

Doing refcounting on the wrong thread for a non-threadsafe object can cause a UAF from a race. This is probably difficult to actually exploit, but I'll conservatively mark it sec-high.

Comment on attachment 9257321 [details]
Bug 1748210 - Always release GetNextTokenCompleteEvent on main thread, r=#necko

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: Probably not easy, since an exploit can be only constructed by race.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: Yes
  • Which older supported branches are affected by this flaw?: all
  • If not all supported branches, which bug introduced the flaw?: n/a
  • Do you have backports for the affected branches?: Yes
  • 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?: Unlikely. Forcing GetNextTokenCompleteEvent to be released on the right thread should not cause any problem.
Attachment #9257321 - Flags: sec-approval?

Comment on attachment 9257321 [details]
Bug 1748210 - Always release GetNextTokenCompleteEvent on main thread, r=#necko

Approved to land and uplift

Attachment #9257321 - Flags: sec-approval? → sec-approval+
Group: network-core-security → core-security-release
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 98 Branch

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?(kershaw)
Whiteboard: [necko-triaged] → [necko-triaged][sec-survey]

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

Comment on attachment 9257321 [details]
Bug 1748210 - Always release GetNextTokenCompleteEvent on main thread, r=#necko

Beta/Release Uplift Approval Request

  • User impact if declined: Possible UAF
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: N/A
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch is straightforward.
  • String changes made/needed: N/A

ESR Uplift Approval Request

  • If this is not a sec:{high,crit} bug, please state case for ESR consideration:
  • User impact if declined: Possible UAF
  • Fix Landed on Version: 98
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The patch is straightforward.
Flags: needinfo?(kershaw)
Attachment #9257321 - Flags: approval-mozilla-esr91?
Attachment #9257321 - Flags: approval-mozilla-beta?

Comment on attachment 9257321 [details]
Bug 1748210 - Always release GetNextTokenCompleteEvent on main thread, r=#necko

Approved for 97.0b3 and 91.6esr.

Attachment #9257321 - Flags: approval-mozilla-esr91?
Attachment #9257321 - Flags: approval-mozilla-esr91+
Attachment #9257321 - Flags: approval-mozilla-beta?
Attachment #9257321 - Flags: approval-mozilla-beta+
Flags: qe-verify-
Whiteboard: [necko-triaged][sec-survey] → [necko-triaged][sec-survey][post-critsmash-triage]
Whiteboard: [necko-triaged][sec-survey][post-critsmash-triage] → [post-critsmash-triage][adv-main97+r]

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?(kershaw)
Whiteboard: [post-critsmash-triage][adv-main97+r] → [post-critsmash-triage][adv-main97+r][sec-survey]

(In reply to Release mgmt bot [:marco/ :calixte] from comment #15)

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.

Done.

Flags: needinfo?(kershaw)
Whiteboard: [post-critsmash-triage][adv-main97+r][sec-survey] → [post-critsmash-triage][adv-main97+r][sec-survey][adv-esr91.6+r]
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: