Assertion failure: mDefinition->mConstructionDepth == mDefinition->mPrefixStack.Length(), at /dom/bindings/BindingUtils.cpp:3739
Categories
(Core :: DOM: Bindings (WebIDL), defect)
Tracking
()
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
| Reporter | ||
Comment 1•10 months ago
|
||
| Reporter | ||
Comment 2•10 months ago
|
||
| Comment hidden (obsolete) |
Comment 4•10 months ago
|
||
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)
Updated•10 months ago
|
Updated•10 months ago
|
Updated•10 months ago
|
| Assignee | ||
Comment 5•10 months ago
|
||
| Assignee | ||
Comment 6•10 months ago
|
||
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.
| Assignee | ||
Comment 7•10 months ago
|
||
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
Updated•10 months ago
|
Comment 8•10 months ago
|
||
Comment on attachment 9543105 [details]
(secure)
sec-approval+, a=dveditz
Updated•9 months ago
|
Updated•9 months ago
|
Comment 10•9 months ago
|
||
Please request beta and ESR uplift ASAP so we can make sure this gets into beta, thanks.
| Assignee | ||
Comment 11•9 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D282162
Updated•9 months ago
|
Comment 12•9 months ago
|
||
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
| Assignee | ||
Updated•9 months ago
|
Comment 13•9 months ago
|
||
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
| Assignee | ||
Comment 14•9 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D282162
Comment 15•9 months ago
|
||
Comment 16•9 months ago
|
||
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.
Comment 17•9 months ago
|
||
:jjaschke, this also needs an uplift request for ESR115
Updated•9 months ago
|
Updated•9 months ago
|
Comment 18•9 months ago
|
||
| uplift | ||
| Assignee | ||
Comment 19•9 months ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D282162
Updated•9 months ago
|
Comment 20•9 months ago
|
||
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
Updated•9 months ago
|
Updated•9 months ago
|
Comment 22•9 months ago
|
||
| uplift | ||
Updated•9 months ago
|
Updated•9 months ago
|
Comment 23•9 months ago
|
||
| uplift | ||
Updated•9 months ago
|
Comment 24•9 months ago
|
||
(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 toDocumentin the code forHTMLConstructor, 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?
Updated•9 months ago
|
| Assignee | ||
Comment 25•9 months ago
•
|
||
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.
Comment 26•9 months ago
|
||
Updated•9 months ago
|
Updated•9 months ago
|
Updated•9 months ago
|
Updated•2 months ago
|
Description
•