Note: All of this is generated by the LLM.
We exploit a TOCTOU bug in Array.prototype.splice (js_array_splice in mquickjs.c) to obtain an out-of-bounds (OOB) write into adjacent heap allocations inside mquickjs’s linear heap arena. We use the OOB write to corrupt a Uint8Array’s internal len field, turning it into an OOB byte read/write primitive. With that primitive we:
- Leak a pointer into the PIE binary (via a ROM
propspointer) and derive the PIE base. - Read the resolved
fwrite@GOTentry to leak libc base. - Overwrite
fwrite@GOTwithsystem.