Closed Bug 2014585 (CVE-2026-2770) Opened 10 months ago Closed 9 months ago

Assertion failure: mDefinition->mConstructionDepth == mDefinition->mPrefixStack.Length(), at /dom/bindings/BindingUtils.cpp:3739

Categories

(Core :: DOM: Bindings (WebIDL), defect)

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
149 Branch
Tracking Status
firefox-esr115 148+ fixed
firefox-esr140 148+ fixed
firefox147 --- wontfix
firefox148 + fixed
firefox149 + verified

People

(Reporter: jkratzer, Assigned: jjaschke)

Details

(5 keywords, Whiteboard: [bugmon:bisected,confirmed][adv-main148+] [adv-esr115.33+] [adv-esr140.8+])

Attachments

(3 files, 4 external files)

Reproduced on mozilla-central rev ab79c347a784 (built with: --enable-debug --enable-fuzzing).

Testcase can be reproduced using the following commands:

$ pip install fuzzfetch grizzly-framework pipx --upgrade
$ python -m pipx ensurepath
$ fuzzfetch --build ab79c347a784 --debug --fuzzing  -n firefox
$ grizzly-replay-bugzilla ./firefox/firefox <bugid>
Assertion failure: mDefinition->mConstructionDepth == mDefinition->mPrefixStack.Length(), at /dom/bindings/BindingUtils.cpp:3739

    ==1358794==ERROR: UndefinedBehaviorSanitizer: SEGV on unknown address 0x000000000000 (pc 0x71ed1ae5ff7b bp 0x7ffcba76d4e0 sp 0x7ffcba76d4d0 T1358794)
    ==1358794==The signal is caused by a WRITE memory access.
    ==1358794==Hint: address points to the zero page.
        #0 0x71ed1ae5ff7b in MOZ_CrashSequence /builds/worker/workspace/obj-build/dist/include/mozilla/Assertions.h:237:3
        #1 0x71ed1ae5ff7b in mozilla::dom::(anonymous namespace)::AutoConstructionDepth::AutoConstructionDepth(mozilla::dom::CustomElementDefinition*) /dom/bindings/BindingUtils.cpp:3738:5
        #2 0x71ed1ae5f764 in mozilla::dom::binding_detail::HTMLConstructor(JSContext*, unsigned int, JS::Value*, mozilla::dom::constructors::id::ID, mozilla::dom::prototypes::id::ID, void (*)(JSContext*, JS::Handle<JSObject*>, mozilla::dom::ProtoAndIfaceCache&, mozilla::dom::DefineInterfaceProperty)) /dom/bindings/BindingUtils.cpp:3971:27
        #3 0x71ed19ddab20 in mozilla::dom::HTMLElement_Binding::_constructor(JSContext*, unsigned int, JS::Value*) /builds/worker/workspace/obj-build/dom/bindings/./HTMLElementBinding.cpp:11891:10
        #4 0x0eadc085c941  ([anon:js-executable-memory]+0xa941)
    
    ==1358794==Register values:
    rax = 0x0000000000000000  rbx = 0x00006303fe4f7680  rcx = 0x0000000000000e9b  rdx = 0x000071ed29204563
    rdi = 0x000071ed29205700  rsi = 0x0000000000000000  rbp = 0x00007ffcba76d4e0  rsp = 0x00007ffcba76d4d0
     r8 = 0x0000000000000000   r9 = 0x0000000000000003  r10 = 0x0000000000000002  r11 = 0x0000000000000293
    r12 = 0x00006303fe46b550  r13 = 0x00007ffcba76d600  r14 = 0x0000000000000092  r15 = 0x0000000000000000
    UndefinedBehaviorSanitizer can not provide additional info.
    SUMMARY: UndefinedBehaviorSanitizer: SEGV (/home/jkratzer/builds/m-c-20260204094524-fuzzing-debug/libxul.so+0x7e5ff7b) (BuildId: 6324a18a77ec64a491609780586d8badab323adb)
    ==1358794==ABORTING
Attached file Detailed Crash Information โ€”
Attached file Testcase โ€”
Keywords: bugmon

Verified bug as reproducible on mozilla-central 20260205042023-4779d1a57487.
Unable to bisect testcase (Testcase reproduces on start build!):

Start: 5223a9e8f62812d59d3daaedadb64d1be3c8757b (20250206161648)
End: ab79c347a7844435bf155b6ff78757fdd6a605d1 (20260204094524)
BuildFlags: BuildFlags(asan=False, tsan=False, debug=True, fuzzing=True, coverage=False, valgrind=False, no_opt=False, fuzzilli=False, nyx=False, searchfox=False, afl=False)

Whiteboard: [bugmon:confirm] → [bugmon:bisected,confirmed]
Keywords: keep-hidden
Assignee: nobody → smaug
Assignee: smaug → jjaschke
Attached file (secure) โ€”

I think that was the testcase claims to be a security issue / exploit isn't a big deal, at least I couldn't find out how to exploit this.
However, there's a raw pointer to Document in the code for HTMLConstructor, and there are pieces which can run script, so that could become UAF. That's also fixed in the patch.

Keywords: sec-high

Comment on attachment 9543105 [details]
(secure)

Security Approval Request

  • How easily could an exploit be constructed based on the patch?: The patch mostly deals with something that I don't think is a real threat. The actual fix is upgrading some raw pointers to RefPtr, which looks like a drive-by.
  • Do comments in the patch, the check-in comment, or tests included in the patch paint a bulls-eye on the security problem?: No
  • Which branches (beta, release, and/or ESR) are affected by this flaw, and do the release status flags reflect this affected/unaffected state correctly?: all
  • If not all supported branches, which bug introduced the flaw?: None
  • Do you have backports for the affected branches?: No
  • If not, how different, hard to create, and risky will they be?: Patch should apply to all branches
  • How likely is this patch to cause regressions; how much testing does it need?: Unlikely.
  • Is the patch ready to land after security approval is given?: Yes
  • Is Android affected?: Yes
Attachment #9543105 - Flags: sec-approval?
Severity: -- → S2

Comment on attachment 9543105 [details]
(secure)

sec-approval+, a=dveditz

Attachment #9543105 - Flags: sec-approval? → sec-approval+

Please request beta and ESR uplift ASAP so we can make sure this gets into beta, thanks.

Flags: needinfo?(jjaschke)
Attached file (secure) โ€”
Attachment #9544239 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined: Sec bug / UAF
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: Test case is in the bug.
  • Risk associated with taking this patch: low
  • Explanation of risk level: Fix is trivial
  • String changes made/needed: No
  • Is Android affected?: yes
Flags: needinfo?(jjaschke)

firefox-esr140 Uplift Approval Request

  • User impact if declined: Sec issue / UAF
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: Testcase is in the bug
  • Risk associated with taking this patch: low
  • Explanation of risk level: Fix is trivial.
  • String changes made/needed: No
  • Is Android affected?: yes
Attachment #9544248 - Flags: approval-mozilla-esr140?
Attached file (secure) โ€”
Group: dom-core-security → core-security-release
Status: NEW → RESOLVED
Closed: 9 months ago
Resolution: --- → FIXED
Target Milestone: --- → 149 Branch

Verified bug as fixed on rev mozilla-central 20260211162125-7df40d9149a3.
Removing bugmon keyword as no further action possible. Please review the bug and re-add the keyword for further analysis.

Status: RESOLVED → VERIFIED
Keywords: bugmon

:jjaschke, this also needs an uplift request for ESR115

Flags: needinfo?(jjaschke)
Attachment #9544239 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
Attached file (secure) โ€”
Attachment #9544509 - Flags: approval-mozilla-esr115?

firefox-esr115 Uplift Approval Request

  • User impact if declined: Sec issue / UAF
  • Code covered by automated testing: no
  • Fix verified in Nightly: yes
  • Needs manual QE test: no
  • Steps to reproduce for manual QE testing: Testcase is in bug
  • Risk associated with taking this patch: low
  • Explanation of risk level: Trivial fix.
  • String changes made/needed: No
  • Is Android affected?: yes

Done.

Flags: needinfo?(jjaschke)
Attachment #9544248 - Flags: approval-mozilla-esr140? → approval-mozilla-esr140+
Attachment #9544509 - Flags: approval-mozilla-esr115? → approval-mozilla-esr115+
Whiteboard: [bugmon:bisected,confirmed] → [bugmon:bisected,confirmed][adv-main148+]

(In reply to Jan Jaeschke [:jjaschke] from comment #6)

I think that was the testcase claims to be a security issue / exploit isn't a big deal, at least I couldn't find out how to exploit this.
However, there's a raw pointer to Document in the code for HTMLConstructor, and there are pieces which can run script, so that could become UAF. That's also fixed in the patch.

What do you mean here by "could"? If we made a mistake in code elsewhere or an attacker can trigger it?

Flags: needinfo?(jjaschke)

If an attacker found out how to exploit it.

There was a function that can run script, and a raw pointer (to Document) was kept and used after that. This is mitigated by replacing the raw pointer with a RefPtr.

Flags: needinfo?(jjaschke)
Attached file advisory.txt โ€”
Whiteboard: [bugmon:bisected,confirmed][adv-main148+] → [bugmon:bisected,confirmed][adv-main148+] [adv-esr115.33+]
Whiteboard: [bugmon:bisected,confirmed][adv-main148+] [adv-esr115.33+] → [bugmon:bisected,confirmed][adv-main148+] [adv-esr115.33+] [adv-esr140.8+]
Alias: CVE-2026-2770
Group: core-security-release
Keywords: keep-hidden
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: