Closed Bug 1475669 Opened 5 years ago Closed 5 years ago

Assertion failure: this->is<T>() with Debugger "promiseDependentPromises"


(Core :: JavaScript Engine, defect, P1)




Tracking Status
firefox-esr60 --- wontfix
firefox62 --- wontfix
firefox63 --- wontfix
firefox64 --- fixed


(Reporter: anba, Assigned: jorendorff)


(Keywords: sec-low, Whiteboard: [post-critsmash-triage][adv-main64+])


(1 file)

Probably not S-S, because the Debugger is involved, but Jason offered to take a look and decide on it. :-)

Test case:
var g = newGlobal();
var dbg = new Debugger();
var gw = dbg.addDebuggee(g);

g.P = Promise;

    function newPromiseCapability() {
        var resolve, reject, promise = new Promise(function(r1, r2) {
            resolve = r1;
            reject = r2;
        return {promise, resolve, reject};

    var {promise} = newPromiseCapability();;

var promise = gw.makeDebuggeeValue(g.promise);


Asserts with:
Assertion failure: this->is<T>(), at /home/andre/git/mozilla-central/js/src/vm/JSObject.h:531

Thread 1 "mozjs-debug" received signal SIGSEGV, Segmentation fault.
0x00000000004acbca in JSObject::as<js::NativeObject> (this=(JSObject *) 0x7ffff7e00bf0 [object Proxy]) at /home/andre/git/mozilla-central/js/src/vm/JSObject.h:531
531             MOZ_ASSERT(this->is<T>());
Group: core-security → javascript-core-security
calling it sec-other while you look at it. If it's not a security bug please unhide it or ping us on #security to do so. If it is please take a stab at a severity rating and replace the sec-other.
Flags: needinfo?(jorendorff)
Keywords: sec-other
Sigh. Predictable. This is sec-low; it's a small part of an exploit, and even if you could fill in the blanks the exploit would have to involve convincing the user to open the debugger.

Easy to fix, just takes time...
Keywords: sec-othersec-low
Priority: -- → P1
Attached patch bug1475669.patchSplinter Review
Unwrap wrappers per |AddPromiseReaction()| [1], including its MOZ_RELEASE_ASSERTs for good measure.

Attachment #8993483 - Flags: review?(jorendorff)
Jason, when would you be able to review André's patch?
Comment on attachment 8993483 [details] [diff] [review]

Review of attachment 8993483 [details] [diff] [review]:

This returns an array of pointers to things in any number of different compartments. That's so strange that the name of the method should point it out.

(I don't know if the Debugger should return dependent promises from non-debuggee compartments or not; I'll check. Separate bug if not.)
Attachment #8993483 - Flags: review?(jorendorff) → review+
Also, this needs a test. Taking.
Assignee: nobody → jorendorff
Flags: needinfo?(jorendorff)
Group: javascript-core-security → core-security-release
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla64
Flags: qe-verify-
Whiteboard: [post-critsmash-triage]
Whiteboard: [post-critsmash-triage] → [post-critsmash-triage][adv-main64+]
Group: core-security-release
You need to log in before you can comment on or make changes to this bug.