SlideShare uma empresa Scribd logo
1 de 24
見つけた
脆弱性について
cybozu.com Security Challenge
My name is
Masato Kinugawa (有力説)
日本人と思われるキヌガワ・マサト (ITmedia説)
クニガワマサト(GIGAZINE説)
Google/Mozilla/Microsoft(IE11)/Facebook
/Etsy/Paypal/Github etc..
見つけた脆弱性
XSS(DOM)
XSS(Flash)
XSS(Flash)
XSS(Flash)
XSS(Flash)
XSS(ブラウザのバグ起因)
アクセス不備
情報漏えい
今回話すもの
XSS(DOM)
XSS(Flash)
XSS(Flash)
XSS(Flash)
XSS(Flash)
XSS(ブラウザのバグ起因)
アクセス不備
情報漏えい
コンテスト開始数分前…
ログインページのURLが伝えられる
見れるものは見ておこう:
robots.txt
crossdomain.xml
エラーページ
HTTPレスポンスヘッダ
静的ファイルが置かれているパス
あれ…
//大体こんなかんじのコード
escaped_url = location.href.replace('&', '&amp;').replace('<',
'&lt;').replace('>', '&gt').replace('"', '&quot;');
document.write('<a href="'+escaped_url+'">'+escaped_url+'</a>');
location.hrefとXSS
Chrome/Safari/IEは#以降に<>などを%エンコード
せずに含められる
• IEは?以降もOK
コンテスト開始
確認してもやっぱり動く
開始して15分後に報告
もう【CySecChallenge-3】、はや!
//修正後
escaped_url = locaton.href.replace(/&/g, '&amp;').replace(/</g,
'&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;');
document.write('<a href="'+escaped_url+'">'+escaped_url+'</a>');
1対1でメッセージを送受信する機能に存在
特定URLにアクセスするとログイン中の第三者(ゲ
ストユーザーを除く)がメッセージの添付ファイルに
アクセス可能
1人に向けて送信しているのに別の人間が閲覧可
能なのは適切でない
アクセス不備
👴 🙋
😈
FILE
MESSAGE
脱線
👴 U+1F474
🙋 U+1F64B
😈 U+1F608
OLDER MAN
HAPPY PERSON RAISING ONE HAND
SMILING FACE WITH HORNS
FlashのXSS(本日のメインコンテンツ)
個人的にFlashのバグを追っていた時期
Flashは相当バグっている
• 先日その一部が修正(CVE-2014-0491)($2,000)
みつけた問題(4件)は
すべて第三者が配布のswfファイル
すべて既知の脆弱性
すべてExternalInterface.call()の問題
ExternalInterface.call()
FlashからJavaScriptを呼び出すために使う
ExternalInterface.call("JS関数","引数")
Flash側の引数の処理が適切でないためXSSを引
き起こしやすい " ➡ "  ➡  (!?)
…
ExternalInterface.call("console.log",loaderInfo.parameters["param"]);
…
//http://example.com/example.swf?param="abc
//実行時にFlashが生成するJavaScript
try{__flash__toXML(console.log(""abc"));}catch (e){"<undefined/>"}
Ctrl+Shift+F
1つ目の問題
2-4つ目の問題
静的ファイルをホストするドメインにXSSが存在
アプリのドメインは app.cybozu-dev.com
静的ファイルのドメインは static.cybozu-dev.com
通常はフィッシング・DoS程度の影響で済む
連鎖
static.cybozu-dev.comにクロスドメインでファイル
の中身を読み出せるFlashツールが存在
app.cybozu-dev.comはcrossdomain.xmlで
static.cybozu-dev.comを許可
XSSでExternalInterface.addCallback()に設定された
関数を細工して呼び出せばapp.cybozu-dev.comの
情報が盗れるような構造だった
crossdomain.xml
…
<cross-domain-policy>
<allow-access-from domain="static.cybozu-dev.com" />
</cross-domain-policy>
…
Flash独自のクロスドメイン制限を緩める設定
ルートに設置することが多い
kintoneにも設置されていた:
https://app.cybozu-dev.com/crossdomain.xml
ExternalInterface.addCallback()
JavaScriptからFlashの関数を呼び出すために使う
…
ExternalInterface.addCallback("jsFunc",flashFunc)
…
<embed name="swf" allowscriptaccess="always"
src="http://example.com/example.swf"></embed>
<script>
swf.jsFunc()
//flashFunc()が呼び出される
</script>
AS
JS
攻撃イメージ
static.cybozu-dev.com app.cybozu-dev.com
xssのあるswf
クロスドメインでレ
スポンスを取得で
きるswf
crossdomain.xml
<allow-access-from
domain="static.cybozu-dev.com" />
ターゲットのページ
機密情報
Check
OK
Request
Response
XSSでロード
&関数呼出
機密情報
具体的に
ExternalInterface.addCallback("jsFunc", send);
//省略
public function send(uri:string):void{
var loader:URLLoader = new URLLoader();
var request:URLRequest = new URLRequest(uri);
loader.load(request);
//省略
ExternalInterface.call("util.xdr",responseText);
util={};util.xdr=function(a){alert(a)}//上書き
swf.jsFunc("http://app.cybozu-dev.com/target")
//レスポンスがalertされる
AS
JS
ところで
動的にJSでswfを作ればいいのでは?
• data: URIやBlobで試したけどうまくいかない
これができたら「crossdomain.xmlで許可しているド
メインにXSS = 設置ドメインの情報が漏れる」ことに
なるんだけど、誰かなんとかならない?
FlashとXSS まとめ
セキュリティチェックの盲点
Same Origin Policyとは異なるセキュリティ制限が
今回のような問題を生むこともある
Flashは相当バグっている(2度目)ので変なところに
XSSが生まれることもある
必要ないファイルは積極的に削除すべき
コンテスト感想
報告された途中経過はずっと1位だった
さらにコンテスト最終日に5件の問題を報告(全て
脆弱性として受理)
余裕で1位か…そうでもない
最後に
コンテスト形式は新鮮で面白かった
第2回に期待!
ありがとうございました!

Mais conteúdo relacionado

Mais procurados (10)

XSS再入門
XSS再入門XSS再入門
XSS再入門
 
体系的に学ばないXSSの話
体系的に学ばないXSSの話体系的に学ばないXSSの話
体系的に学ばないXSSの話
 
XOOPS Securilty flow
XOOPS Securilty flowXOOPS Securilty flow
XOOPS Securilty flow
 
Djangoのセキュリティとその実装
Djangoのセキュリティとその実装Djangoのセキュリティとその実装
Djangoのセキュリティとその実装
 
楽しいバグハントの世界
楽しいバグハントの世界楽しいバグハントの世界
楽しいバグハントの世界
 
Traffix Jam インストール方法
Traffix Jam インストール方法Traffix Jam インストール方法
Traffix Jam インストール方法
 
ITPと、その他cookie関連のこと / ITP and cookie
ITPと、その他cookie関連のこと / ITP and cookieITPと、その他cookie関連のこと / ITP and cookie
ITPと、その他cookie関連のこと / ITP and cookie
 
Play_using_Proxy
Play_using_ProxyPlay_using_Proxy
Play_using_Proxy
 
Securing Supply Chains
Securing Supply ChainsSecuring Supply Chains
Securing Supply Chains
 
Word benchfukuoka
Word benchfukuokaWord benchfukuoka
Word benchfukuoka
 

Destaque

HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir GoldshlagerHES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
Nir Goldshlager
 

Destaque (20)

SecurityCamp2015「バグハンティング入門」
SecurityCamp2015「バグハンティング入門」SecurityCamp2015「バグハンティング入門」
SecurityCamp2015「バグハンティング入門」
 
X-XSS-Nightmare: 1; mode=attack ~XSSフィルターを利用したXSS攻撃~
X-XSS-Nightmare: 1; mode=attack ~XSSフィルターを利用したXSS攻撃~X-XSS-Nightmare: 1; mode=attack ~XSSフィルターを利用したXSS攻撃~
X-XSS-Nightmare: 1; mode=attack ~XSSフィルターを利用したXSS攻撃~
 
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS FilterX-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
X-XSS-Nightmare: 1; mode=attack XSS Attacks Exploiting XSS Filter
 
HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir GoldshlagerHES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
HES 2012- Killing a Bug Bounty Program by Itzhak Zuk Avraham&Nir Goldshlager
 
iPhone Data Protection in Depth
 iPhone Data Protection in Depth iPhone Data Protection in Depth
iPhone Data Protection in Depth
 
Antid0te 2.0 – ASLR in iOS
Antid0te 2.0 – ASLR in iOSAntid0te 2.0 – ASLR in iOS
Antid0te 2.0 – ASLR in iOS
 
iOS 6 Exploitation: 280 days later
iOS 6 Exploitation: 280 days lateriOS 6 Exploitation: 280 days later
iOS 6 Exploitation: 280 days later
 
Hacking Webkit & Its JavaScript Engines
Hacking Webkit & Its JavaScript EnginesHacking Webkit & Its JavaScript Engines
Hacking Webkit & Its JavaScript Engines
 
Attacking the Webkit heap [Or how to write Safari exploits]
Attacking the Webkit heap [Or how to write Safari exploits]Attacking the Webkit heap [Or how to write Safari exploits]
Attacking the Webkit heap [Or how to write Safari exploits]
 
Bug-hunter's Sorrow
Bug-hunter's SorrowBug-hunter's Sorrow
Bug-hunter's Sorrow
 
Targeting the iOS kernel
Targeting the iOS kernelTargeting the iOS kernel
Targeting the iOS kernel
 
SecurityCamp2015「CVE-2015-4483解説」
SecurityCamp2015「CVE-2015-4483解説」SecurityCamp2015「CVE-2015-4483解説」
SecurityCamp2015「CVE-2015-4483解説」
 
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web AppsSenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
SenchaCon 2016: Expect the Unexpected - Dealing with Errors in Web Apps
 
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory HardySenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
SenchaCon 2016: JavaScript is Great but Stop Writing It - Rory Hardy
 
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
SenchaCon 2016: Improve Workflow Driven Applications with Ext JS Draw Package...
 
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
SenchaCon 2016: Handle Real-World Data with Confidence - Fredric Berling
 
PFSなTLS通信を復号する
PFSなTLS通信を復号するPFSなTLS通信を復号する
PFSなTLS通信を復号する
 
20160416 Azure Data Lakeのはまりどころ
20160416 Azure Data Lakeのはまりどころ20160416 Azure Data Lakeのはまりどころ
20160416 Azure Data Lakeのはまりどころ
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
めとべや東京10 Universal Windows Platform appの新しいバインディング
めとべや東京10 Universal Windows Platform appの新しいバインディングめとべや東京10 Universal Windows Platform appの新しいバインディング
めとべや東京10 Universal Windows Platform appの新しいバインディング
 

Último

Último (12)

Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
Observabilityは従来型の監視と何が違うのか(キンドリルジャパン社内勉強会:2022年10月27日発表)
 
新人研修 後半 2024/04/26の勉強会で発表されたものです。
新人研修 後半        2024/04/26の勉強会で発表されたものです。新人研修 後半        2024/04/26の勉強会で発表されたものです。
新人研修 後半 2024/04/26の勉強会で発表されたものです。
 
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアルLoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
LoRaWAN スマート距離検出デバイスDS20L日本語マニュアル
 
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
論文紹介:Video-GroundingDINO: Towards Open-Vocabulary Spatio-Temporal Video Groun...
 
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その32024/04/26の勉強会で発表されたものです。
 
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
論文紹介: The Surprising Effectiveness of PPO in Cooperative Multi-Agent Games
 
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
NewSQLの可用性構成パターン(OCHaCafe Season 8 #4 発表資料)
 
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
知識ゼロの営業マンでもできた!超速で初心者を脱する、悪魔的学習ステップ3選.pptx
 
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
論文紹介:Selective Structured State-Spaces for Long-Form Video Understanding
 
Utilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native IntegrationsUtilizing Ballerina for Cloud Native Integrations
Utilizing Ballerina for Cloud Native Integrations
 
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
Amazon SES を勉強してみる その22024/04/26の勉強会で発表されたものです。
 
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
LoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイスLoRaWANスマート距離検出センサー  DS20L  カタログ  LiDARデバイス
LoRaWANスマート距離検出センサー DS20L カタログ LiDARデバイス
 

見つけた脆弱性について(cybozu.com Security Challenge)