pwniumで勝つ方法 セキュリティ入門 - pacsec...use-after-free脆弱性の軽減 a =...
TRANSCRIPT
概要
● アーキテクチャ
● サンドボックスの中へ
○ レンダラーのバグ
○ Use-after-Free脆弱性の軽減
● サンドボックスの外へ
○ プロセス間通信
● これから
アーキテクチャ
Browser
Filesystem Network
RendererPlugin
Renderer
GPU
Worker
= サンドボックス内= プロセス間通信
アーキテクチャ / Architecture
Browser
Filesystem Network
RendererPlugin
Renderer
GPU
Worker
Network Plugin
V8
OSOS
OS OS
OS
= サンドボックス内= プロセス間通信
Blink/V8 バインディング入門
= 強い参照
ABlink Object
interface A { attribute DOMString width;}
V8_A
V8 Wrapper
インターフェース定義IDL
Blink heap参照カウント
V8 heapGC
循環参照
AB
D C
循環参照
AB
D C
1
2
1 1
= 強い参照
循環参照
AB
D C
0
2
1 1
= 強い参照
循環参照
B
D C
1
1 1
= 強い参照
循環参照
AB
D C= 強い参照
= 弱い参照(生ポインタ)
B
循環参照
AB
D C= 強い参照
= 弱い参照(生ポインタ)
B
循環参照
AB
D CWebCore::SourceBufferList
WebCore::MediaSource
WebCore::SourceBuffer
WebCore::HTMLMediaElement
http://scarybeastsecurity.blogspot.com/2013/02/exploiting-64-bit-linux-like-boss.html
= 強い参照
= 弱い参照(生ポインタ)
B
Use-after-Free脆弱性の軽減
A V8_A
V8_Uint8Array
Blink heap参照カウント
V8 heapGC
= 強い参照
= 弱い参照(生ポインタ)
B
Use-after-Free脆弱性の軽減
A V8_A
V8_Uint8Array
V8_B
V8 heapGC
Blink heap参照カウント
= 強い参照
= 弱い参照(生ポインタ)
B
Use-after-Free脆弱性の軽減
A V8_A
Blink heap参照カウント
V8 heapGC
= 強い参照
= 弱い参照(生ポインタ)
Partition Alloc
● 同じ基底クラスから派生しているクラス● 同じ大きさ
Partition外では仮想メモリ領域を再利用しない
実施済 ● DOM● RenderObject● ArrayBuffer● String, Vector,
Hashtable
未実施● ScriptWrappables not under Node● everything else
現状
一定条件を満たすオブジェクトを同じ仮想メモリ領域に確保
dev channel
B
Use-after-Free脆弱性の軽減
A
= 強い参照 = 弱い参照(生ポインタ)もしくは型情報が失われたポインタ
V8_A
V8_B
ポインタは本当にBを指してる?
たぶん
指してない
CRASH
Blink heap参照カウント
V8 heapGC
Browser
プロセス間通信の概要
引数のデシリアライズ /
Renderer
引数のシリアライズ
new IPC::Message
Send
対象オブジェクトの特定
コールバックの呼 OnMessageReceived(...)
ソケットもしくは名前付きパイプ
= サンドボックス内= プロセス間通信
プロセス間通信での頻出バグ
enum値チェックの欠如
content_accessed_[type] = true;
some_map[key]->second.some_method();
連想配列キーチェックの欠如
複雑なステートマシン
パストラバーサルhttps://codereview.chromium.org/12212091
レースコンディション
crbug.com/121726
整数オーバーフロー
crbug.com/169685
ロジックの誤り
crbug.com/162114
https://src.chromium.org/viewvc/chrome?revision=206130&view=revision
crbug.com/169770
https://src.chromium.org/viewvc/chrome?revision=203389&view=revision
WebUIバインディング
chrome.send(“openFile”, [“1”]);
chrome://history chrome://downloads
Browser
ChildProcessSecurityPolicy
これから
● NaCl移行の推進
● Partition化の推進
● ランタイムのメモリ安全性強化
● カーネル攻撃対象領域の最小化
● 頻出バグ種の根絶
● サイト間分離
● ______ での書き換え?
さいごに
https://code.google.com/p/chromium/codesearch
Chromiumのクロスレファレンスコードビューアです。大変便利なので是非ご覧になってください!