Sandboxing V8
Sandboxing V8
which can then be exploited for (more or less arbitrary) memory corruption at runtime
GVN
Type-Check (global value numbering)
BCE
Elimination CVE-2019-9810 (bounds-check
elimination)
CVE-2019-17026 Alias CVE-2017-2547 Array Length
Analysis Computation
Type CSE
Inference Runtime
(common subexpression
elimination) Range
CVE-2018-4233
CVE-2018-17463 State Analysis
CVE-2019-11707 crbug 762874 (2017)
CVE-2019-8506
CVE-2020-6418 crbug 880207 (2018)
CVE-2021-30551
CVE-2021-30561 “Pureness” CVE-2019-13764
CVE-2021-30632 Analysis
CVE-2022-3723
CVE-2020-9802 Pattern
Matching
Temporal Write Barrier
CVE-2021-30598
CVE-2021-30599
Memory Lowering
Elision GC
Safety Modelling
CVE-2021-21220
crbug 1377775 (2022)
CVE-2019-4442
CVE-2019-8622
How?
0xa48000000000
V8 Sandbox (e.g. 1TB)
0xa38000000000
Lower Addresses
Higher Addresses
0xa48000000000
V8 Sandbox (e.g. 1TB)
0xa38100000000
V8 Heap (4GB)
0xa38000000000
Lower Addresses
Higher Addresses
0xa48000000000
V8 Sandbox (e.g. 1TB)
Wasm Memory
Cage (10GB)
ArrayBuffer1
0xa38100000000
HeapObj1 V8 Heap (4GB)
HeapObj4
HeapObj2
HeapObj3 HeapObj5
0xa38000000000
ExternalObj1
Lower Addresses
Higher Addresses
0xa48000000000
V8 Sandbox (e.g. 1TB)
Wasm Memory
Cage (10GB)
ArrayBuffer1
0xa38100000000
HeapObj1 V8 Heap (4GB)
HeapObj4
32-bit offset HeapObj2
HeapObj3 (compressed pointer) HeapObj5
0xa38000000000
ExternalObj1
Lower Addresses
Higher Addresses
0xa48000000000
V8 Sandbox (e.g. 1TB)
Wasm Memory
Cage (10GB)
ArrayBuffer1
0xa38100000000
HeapObj1 V8 Heap (4GB)
HeapObj4
32-bit offset HeapObj2
HeapObj3 (compressed pointer) HeapObj5
0xa38000000000
ExternalObj1
Lower Addresses
Higher Addresses
0xa48000000000
V8 Sandbox (e.g. 1TB)
Wasm Memory
Cage (10GB)
ArrayBuffer1
0xa38100000000
HeapObj1 V8 Heap (4GB)
HeapObj4
32-bit offset HeapObj2
HeapObj3 (compressed pointer) HeapObj5
0xa38000000000
0xa48000000000
n ow
is
g in
h ere
E D
h in
S T
Ev
eryt
R U 0xa38100000000
N T
U 0xa38000000000
Lower Addresses
Implications Beyond V8
int idx = ...;
v8_obj->SetInternalField(0, v8_num(idx));
...
...
return array[idx];
Implications Beyond V8
int idx = ...;
v8_obj->SetInternalField(0, v8_num(idx));
...
...
return array[idx];
Implications Beyond V8
int idx = ...;
v8_obj->SetInternalField(0, v8_num(idx));
...
...
return array[idx];
Goals of the V8 Sandbox
Goals of the V8 Sandbox