Closed Bug 1727281 Opened 4 years ago Closed 4 years ago

Assertion failure: !isIndex(), at /js/src/vm/StringType.h:2004

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect

Tracking

()

VERIFIED FIXED
93 Branch
Tracking Status
firefox-esr78 --- unaffected
firefox-esr91 --- unaffected
firefox91 --- unaffected
firefox92 --- unaffected
firefox93 --- verified

People

(Reporter: decoder, Assigned: anba)

References

(Regression)

Details

(Keywords: assertion, regression, testcase, Whiteboard: [bugmon:update,bisected,confirmed])

Attachments

(4 files)

The following testcase crashes on mozilla-central revision 20210824-7857f4c37a92 (debug build, run with --fuzzing-safe --ion-offthread-compile=off):

a = {
  0: class { #$() {} }
}

Backtrace:

received signal SIGSEGV, Segmentation fault.
#0  0x0000555556c24bcb in JSAtom::asPropertyName() ()
#1  0x0000555556c0647b in Interpret(JSContext*, js::RunState&) ()
#2  0x0000555556c03b31 in js::RunScript(JSContext*, js::RunState&) ()
[...]
#10 0x0000555556a706ae in main ()
rax	0x55555576fc97	93824994442391
rbx	0x3311cf04640	3509473789504
rcx	0x555558128820	93825038190624
rdx	0x0	0
rsi	0x7ffff7105770	140737338431344
rdi	0x7ffff7104540	140737338426688
rbp	0x7fffffffc0c0	140737488339136
rsp	0x7fffffffc0a0	140737488339104
r8	0x7ffff7105770	140737338431344
r9	0x7ffff7f98840	140737353713728
r10	0x0	0
r11	0x0	0
r12	0xffff800000000000	-140737488355328
r13	0xfffaffffffffffff	-1407374883553281
r14	0x100000f58	4294971224
r15	0x55555809d990	93825037621648
rip	0x555556c24bcb <JSAtom::asPropertyName()+267>
=> 0x555556c24bcb <_ZN6JSAtom14asPropertyNameEv+267>:	movl   $0x7d4,0x0
   0x555556c24bd6 <_ZN6JSAtom14asPropertyNameEv+278>:	callq  0x555556b06a2a <abort>

Marking this s-s because it looks like some kind of potential type confusion, looking at the code/assert.

Attached file Testcase

Did a bisect:

The first bad revision is:
changeset:   678261:5e6d1848ce62
user:        André Bargull <andre.bargull@gmail.com>
date:        Tue Aug 10 10:05:03 2021 +0000
summary:     Bug 1723155 - Part 8: Add NewPrivateName opcode. r=mgaudet
Regressed by: 1723155
Has Regression Range: --- → yes

Anba: Want to take a quick look? Otherwise, I'll come back to this tomorrow.

Flags: needinfo?(andrebargull)

Bugmon Analysis
Verified bug as reproducible on mozilla-central 20210824094724-7857f4c37a92.
The bug appears to have been introduced in the following build range:

Start: cbcbf9b36569130af1e5e90b02fe3a0f5bd50c96 (20210810100203)
End: 0ab8644c9e7103e10a910b08fde5c41c014bb3d0 (20210810100905)
Pushlog: https://hg.mozilla.org/integration/autoland/pushloghtml?fromchange=cbcbf9b36569130af1e5e90b02fe3a0f5bd50c96&tochange=0ab8644c9e7103e10a910b08fde5c41c014bb3d0

Whiteboard: [bugmon:update,bisect] → [bugmon:update,bisected,confirmed]
Assignee: nobody → andrebargull
Status: NEW → ASSIGNED

Add a regression test case.

Depends on D123510

Actually it's fine to open this bug, because it can't be exploited in any way:
The JSAtom incorrectly treated as a PropertyName is only passed to js::NewPrivateName(), which in turn passes it to JS::Symbol::new_(). But because JS::Symbol::new_() accepts HandleString (aka JSString), the incorrect PropertyName type is discarded, so it's not possible to cause any harm.

Flags: needinfo?(andrebargull)

Opening per comment 8.

Group: javascript-core-security

Set release status flags based on info from the regressing bug 1723155

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

Bugmon Analysis
Verified bug as fixed on rev mozilla-central 20210825214919-6c984a259bdc.
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
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: