Closed Bug 1904642 Opened 3 months ago Closed 3 months ago

Assertion failure: cx->realm() == state.script()->realm(), at js/src/vm/Interpreter.cpp:422

Categories

(Core :: JavaScript Engine, defect, P3)

defect

Tracking

()

RESOLVED FIXED
129 Branch
Tracking Status
firefox129 --- fixed

People

(Reporter: nils.bars, Assigned: jonco)

References

(Blocks 1 open bug)

Details

(Keywords: reporter-external)

Attachments

(2 files)

Attached file bug.js

Steps to reproduce:

Checkout commit 9fcc11127fbfbdc88cbf37489dac90542e141c77 and invoke the js shell as follows:

js --fuzzing-safe <test-case>

Actual results:

Assertion failure: cx->realm() == state.script()->realm(), at js/src/vm/Interpreter.cpp:422
Blocks: 1903968
Group: firefox-core-security → core-security
Component: Untriaged → JavaScript Engine
Product: Firefox → Core
Group: core-security → javascript-core-security

Reduced test below. It looks like we create a module object with a script from a different realm and this confuses ModuleObject::execute when it tries to execute it.

Jon, can this case happen in the browser or are we just missing a check for this in the shell's testing function?

var mod = parseModule("a");
d = newGlobal().registerModule("c", mod);
moduleLink(d);
moduleEvaluate(d);
Flags: needinfo?(jcoppeard)

The problem is in the shell function registerModule(). This can't happen in the browser.

Assignee: nobody → jcoppeard
Flags: needinfo?(jcoppeard)
Group: javascript-core-security
Severity: -- → S3
Priority: -- → P3
Pushed by jcoppeard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3e39867430df Check module realm in shell registerModule function r=jandem
Status: UNCONFIRMED → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 129 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: