Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DOM Invader - prototype pollution対応の衝撃 - / DOM ...
Search
okuken
June 27, 2022
Technology
870
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DOM Invader - prototype pollution対応の衝撃 - / DOM Invader - prototype pollution
okuken
June 27, 2022
More Decks by okuken
See All by okuken
全集中Burp extension ISTE勉強会 第1回 / Burp ISTE study 01
okuken
0
510
全集中Burp extension ISTE v0.5.0 ー Request chain の躍進 / Burp extension ISTE v050
okuken
0
460
npm Security ー サプライチェーン攻撃の観点から ー
okuken
1
700
全集中 Burp extension ISTE リリース1周年記念 - 振り返り - / Burp extension ISTE 1st Anniversary
okuken
0
580
Dangerous usage of JNDI
okuken
0
490
全集中 Burp extension ISTE v0.4リリース / Burp extension ISTE v0.4
okuken
0
510
Web Messaging のセキュリティ - DOM Invaderを添えて - / Web Messaging Security
okuken
0
2.9k
DOM Invader - Burp Suiteの新機能でJavaScriptに立ち向かう - / DOM Invader
okuken
0
1.7k
#BurpISTEで!SECCON Beginners CTF 2021 Web問に全集中した話 / ctf4b 2021 with ISTE
okuken
1
600
Other Decks in Technology
See All in Technology
AI-DLC実践録_フルサイクル開発への挑戦
miyuc
0
270
Go 1.27 の標準パッケージに uuid が入った!のでいろいろ喋る / go_127_std_go_uuid
convto
2
480
老害フォレンジッカーはAI羊の夢を見るか?
tadmaddad
0
350
SmartHR Engineering Team Deck
smarthr
1
2.9k
つくって納得、つかって実感! 大規模言語モデルことはじめ ver2.0
recruitengineers
PRO
5
2k
Bits Agent Builder の⼊⾨と活⽤事例
nulabinc
PRO
0
200
Head First モブプログラミング / Head First Mobprogramming
takaking22
10
12k
猫付きpingコマンドを自作
uyuki234
0
260
Flutter × BLE Centralを自前Pluginで実装する設計パターン - MethodChannel / EventChannelで作る双方向ブリッジの実践 / Building Custom Flutter BLE Central Plugins: Bidirectional Bridging with Method & Event Channels
bitkey
PRO
0
110
小粒でもパワフルなJS Runtime Antjsについて
comamoca
0
110
現場回帰したデータエンジニアが考える AI 時代のキャリア開発 / Career Development in the Age of AI Perspectives from a Hands-on Data Engineer
medley
0
190
LLM Internals: 언어 모델의 계보와 알고리즘 진화 (2023~2026)
inureyes
PRO
0
720
Featured
See All Featured
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
1
470
Amusing Abliteration
ianozsvald
1
250
Bootstrapping a Software Product
garrettdimon
PRO
307
120k
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.4k
Building AI with AI
inesmontani
PRO
1
1.1k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
1
400
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
990
First, design no harm
axbom
PRO
2
1.3k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
490
Building a Scalable Design System with Sketch
lauravandoore
463
34k
The agentic SEO stack - context over prompts
schlessera
0
870
Transcript
DOM Invader ー prototype pollution 対応の衝撃 ー @okuken3 2022.06.27 第20回
初心者のためのセキュリティ勉強会
0. 自己紹介 1. DOM Invader が prototype pollution に対応! 2.
DOM Invader の復習 3. DOM Invader で prototype pollution を試してみよう! 4. まとめ Agenda
Kenichi Okuno Twitter: @okuken3 自己紹介 ・セキュリティエンジニア ・三井物産セキュアディレクション(MBSD)所属 ・主にWebアプリケーション脆弱性診断を担当 ・趣味で全集中Burp extension
ISTEを開発 ・過去職ではWebアプリ開発やプロダクトセキュリティなど 最近の出来事/一言 ・運動の習慣化 ・ISTEのSlackお気軽にご参加ください
1. DOM Invader が prototype pollution に対応!
リリース情報 Professional / Community 2022.6 [Early Adopter] (20 June 2022
at 12:37 UTC) https://portswigger.net/burp/releases/professional-community-2022-6
ドキュメント / 公式ブログ DOM Invader [PROFESSIONAL] [COMMUNITY] https://portswigger.net/burp/documentation/desktop/tools/dom-invader - prototype pollution
関連の記載はなし(2022/06/25時点) Finding client-side prototype pollution with DOM Invader https://portswigger.net/blog/finding-client-side-prototype-pollution-with-dom-invader - 解説動画あり ★おすすめ★ - prototype pollution 自体の平易な解説もあり Widespread prototype pollution gadgets https://portswigger.net/research/widespread-prototype-pollution-gadgets - prototype pollution gadget の具体例をソースコードを交えて解説
2. DOM Invader の復習
※※ 詳細は過去LT資料を参照ください ※※ DOM Invader - Burp Suiteの新機能でJavaScriptに立ち向かう - https://speakerdeck.com/okuken/dom-invader
Web Messaging のセキュリティ - DOM Invaderを添えて - https://speakerdeck.com/okuken/web-messaging-security
端的に言うと ✓ 興味深いシンクとソースを検出&一覧表示! ✓ スタックトレースの表示&該当行へジャンプ! ✓ Web Messaging 特化の機能群もあるよ! 復習
ソース?シンク?? 復習
ソース?シンク?? eval element.innerHTML 値 location.pathname document.cookie location.hash 復習
DOM Invader の起動 1. Early Adopter になる - DOM Invaderは正式リース前であり、Early
Adopterにのみ提供されている(2022/06/27時点) - 設定経路:User options > Misc > Updates - 設定後に Help > Check for updates を実行すると、Early Adopterのリリースが取得される initial problems が含まれる版になるため、Burpを業務利用している場合は注意が必要です。 復習
2. 内蔵ブラウザを起動する - DOM Invader は内蔵ブラウザ(Chromium)のアドオンとして実装されている - 起動経路:Proxy > Intercept
> Open Browser 3. Burp Suite Container extension(アドオン)をピン留めする DOM Invader の起動 復習
4. DOM Invader を有効化する - デフォルトはoff(対象のWebアプリケーションを壊しかねないため) ※公式ドキュメント参照 診断対象以外のサイトにアクセスする際は無効化しておくのが無難でしょう。 DOM Invader
の起動 復習
1. 開発者ツールを起動する(F12) DOM Invader の使い方 DOM Invader の独自タグが追加されている ※最新版ではタブが1つに統合されており、 タブ名は「DOM
Invader」となっている シンク(Sinks)とソース(Sources)は ここに表示される 便利機能ボタン 復習
2. Consoleタブを画面下部に表示しておく(ESC) あとで使います! DOM Invader の使い方 復習
3. DOM Invader で prototype pollution を試してみよう!
1. 検証用サイトを開く https://portswigger-labs.net/dom-invader-prototype-pollution/ 公式ブログでも紹介されていた、 「prototype-pollution-query-string-gadget」 で動作を確認してみました。
2. Prototype pollution を有効化 ①「Prototype pollution is on」へ変更 ②「Reload」押下
3. Prototype pollution sources(ソース)が検出された! ① Prototype pollution sources が2箇所検出された! ②「Scan
for gadgets」を押下して、 Prototype pollution gadgets のスキャンを開始する!
4. Prototype pollution gadgets を検索中・・・完了!検出あり!
5. Prototype pollution gadgets(シンク)が検出された! ① Prototype pollution gadgets が1箇所検出された! ②「Exploit」を押下して、
Prototype pollution によるXSSの発火を試みる!
6. XSS発火!! Prototype pollution によるXSSのためのペイロードが URLパラメータに追加されている。 開発者ツールのElementsタブでDOMの様子を確認。 URLパラメータで指定されたimgタグが挿入されている。
7. Prototype pollution gadgets(シンク)のJavaScriptコードを確認する ①「Stack Trace」のリンクをクリック ② Consoleに出力されたスタックトレースの中で、 確認したい箇所のリンクをクリック
8. ・・・??? 空っぽ…
9. (気を取り直して) スタックトレースに記載の行番号のJavaScriptコードを見に行く (別画面のSourcesタブにて)該当箇所である110行27列目を確認。 innerHTML(=HTMLエスケープ無し) に o.html を代入している。 Prototype pollution
source を利用することで o.html の汚染が可能であれば、 XSSのペイロードで汚染することにより、XSSが成立する。
10. Prototype pollution sources(ソース)のJavaScriptコードを確認する ①「Stack Trace」のリンクをクリック ② Consoleに出力されたスタックトレースの中で、 確認したい箇所のリンクをクリック
11. Prototype pollution sources(ソース)のJavaScriptコードを確認する この時点で、cur には {} で初期化された Object が入っており、
keys にはリクエストパラメータのパラメータ名を分割した配列が入っている。 先の例では、リクエストパラメータ __proto__[html]=<img src onerror=alert(1)> が設定されていたので、 keys は [‘__proto__’, ‘html’] であり、 forループの1周目で cur に {}.__proto__ が代入され、 forループの2周目で {}.__proto__.html = “<img src onerror=alert(1)>” が実行され、プロトタイプ汚染が 成立する。そして、汚染されたプロパティが先述の innerHTML への代入処理において o.html にて参照される。
まとめ ✓ DOM Invader が prototype pollution に対応! ✓ prototype
pollution source および gadget の検出から Exploit まで! ✓ 正式リリースが待ち遠しい!
None