SlideShare a Scribd company logo
1 of 22
Download to read offline
Fourteenforty Research Institute, Inc.
1
Tizenセキュリティ
Fourteenforty Research Institute, Inc.
株式会社 フォティーンフォティ技術研究所
http://www.fourteenforty.jp
シニア・リサーチ・エンジニア
鈴木 秀一郎
Fourteenforty Research Institute, Inc.
• iOS, Androidに代わる新たスマートフォン・タブレットOSとして、TizenやFirefox OS
が注目されている
• 国内でも、年内か来年にはTizen OS搭載の端末がリリースされるとの情報
• Androidもリリース以降、常にセキュリティ面は注目されてきた
• 新たなOSのセキュリティはどうなのだろうか?
• 今回はTizenのセキュリティについて調査
• Tizen SDK 2.1のエミュレータを用いて調査
背景
2
Fourteenforty Research Institute, Inc.
• 概要
– モバイルデバイス向けオープンソースOS
– Linux Foundationのプロジェクトの一つ
– サムスン電子とインテルによって主導されている
• 特徴
– Linuxベース
– Tizen 2.0からはWebおよびNative(C/C++)でのアプリ開発をサポート
Tizen概要
3
Fourteenforty Research Institute, Inc.
Tizenアーキテクチャ
4
http://upload.wikimedia.org/wikipedia/commons/c/c3/What_is_tizen_architecture.pngより転載
WebおよびNativeアプリをともにサポート
Fourteenforty Research Institute, Inc.
• 二つのパッケージフォーマット
– Tizen Package (.tpk) : Native Applications
– Tizen Web Package (.wgt) : Web Applications
Tizen Package
5
Fourteenforty Research Institute, Inc.
• インストール先は /opt/apps/(AppId)
• AppIdは10バイトの文字列
• /opt/apps/(AppId)下は
– bin/
– data/
– res/
などが含まれる
Tizen アプリ Web/Native 共通事項
6
Fourteenforty Research Institute, Inc.
Tizen Web package
7
https://developer.tizen.org/documentation/articles/tizen-application-packaging-overviewより引用
• 拡張子 .wgt を持つZipアーカイブ
• .wgtファイルは以下の図の赤枠内の構造を持つ
• binディレクトリ下にWeb Runtime(WRT)へのシンボリックリンクが作成される
• 起動時にはこのファイルが実行されWebアプリをホストする
Fourteenforty Research Institute, Inc.
• 拡張子 .tpk を持つZipアーカイブ
• .tpkファイルはAppId下の構造をそのまま持つ
• binディレクトリ下に直接Nativeコードのバイナリが配置される
Tizen Native package
8
https://developer.tizen.org/documentation/articles/tizen-application-packaging-overviewより引用
Fourteenforty Research Institute, Inc.
セキュリティ
9
• 以下の項目について、調査
– OSレベルのセキュリティ
• アクセス制御
• 脆弱性攻撃防御
• Content Security Framework
– アプリの権限分離
• Privileges
• Feature
Fourteenforty Research Institute, Inc.
アクセス制御概要
10
• すべてのプロセスは以下の二つのユーザーで動作
– root
– app
• Webアプリ、NativeアプリともにUID “app”で動作
• SMACKによる強制アクセス制御
– すべてのアプリはSmackでラベルづけされる
Fourteenforty Research Institute, Inc.
2つのUIDの利用
11
Kernel
Web App1
Web Runtime
(UID: app)
Web App2
Native App
(UID: app)
Service
(UID: root)
UID appで動作
高い権限の必要な
サービス類は
rootで動作
Fourteenforty Research Institute, Inc.
アプリ同士の分離
12
アプリはすべてUID “app”で動作
↓
アプリ同士は互いのファイルへアクセス可能??
SMACKによるアクセス制御
(アプリ同士はデフォルトで干渉不可)
Fourteenforty Research Institute, Inc.
• LSM(Linux Security Modules)の一つ
• Subject (≒プロセス)と Object (≒ファイル)にラベルを付け、ラベル間のア
クセスルールを書くことでアクセス制御を行う
• アクセスルール例:
SMACK
13
ラベル“TopSecret”を持つSubjectは
TopSecret Secret rx
ラベル“Secret”を持つObjectに 読み取り、実行可能
Fourteenforty Research Institute, Inc.
SMACK Labelの利用
14
Kernel
Web App1
Web Runtime
(UID: app)
Web App2
Native App1
(UID: app)
Service1
(UID: root)
UID appで動作
高い権限の必要な
サービス類は
rootで動作
WebApp1
SMACK Label
WebApp2 NativeApp1
File1
WebApp1
File2
WebApp2
WebApp2ラベルを持つ
ファイルへはアクセス不可
Service1
Fourteenforty Research Institute, Inc.
脆弱性防御
15
• Tizen 2.0からNative (C/C++)によるアプリ開発をサポート
• 典型的なバッファオーバーフロー脆弱性の可能性
• ASLR および DEPが基本対策
Fourteenforty Research Institute, Inc.
DEP
16
• 以下のコードをTizen Native Applicationとして実行
int func(){
int a = 10;
int b = 20;
return a+b;
}
_EXPORT_ int OspMain(int argc, char *pArgv[])
{
AppLog("Application started.");
char buf[1024];
int (*f)();
memcpy( buf, (char*)func, 1024);
f = (int (*)())buf;
int b = f();
ArrayList args(SingleObjectDeleter);
args.Construct();
…..
スタックにバッファを用意
スタックにfuncをコピー
スタック上のコードを実行
特に問題なく動作
DEPは無効
(Tizen SDK 2.1 x86 Emulator上にて)
Fourteenforty Research Institute, Inc.
ASLR
17
• /proc/sys/kernel/randomize_va_space は 2
= ASLR有効であるという意味
• 実際には…(Tizen Native Appを用いてエミュレータで確認)
– 同じプログラムを2回起動。/proc/[pid]/mapsの主要なモジュール、ヒープ、ス
タックのアドレスは2回とも結果は変化なし
→ ランダマイズされていない(Tizen SDK 2.1 x86 Emulator上にて)
• /proc/self/personalityの値が 00040000 (ADDR_NO_RANDOMIZE)
– ASLRはこれによって無効化されている
09e0e000-09e70000 rw-p 00000000 00:00 0 [heap]
09e70000-09f80000 rw-p 00000000 00:00 0 [heap]
b36e7000-b36ec000 r-xp 00000000 fe:00 73077 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7.exe
b36ec000-b36ed000 rw-p 00004000 fe:00 73077 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7.exe
b36ed000-b36f0000 r-xp 00000000 fe:00 73094 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7
b36f0000-b36f1000 rw-p 00002000 fe:00 73094 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7
bfdcf000-bfdf0000 rw-p 00000000 00:00 0 [stack]
Fourteenforty Research Institute, Inc.
Applications
Content Security Framework(CSF)
18
• Tizenにセキュリティチェック機能を柔軟に提供できるようにする仕組み
• CSFはAPIおよびPlug-inのインターフェースを規定
• セキュリティチェック機能はPlug-in (libengine.so)として提供
• Plug-inはファイル、URL、Webサイト(HTML, JavaScript)などのチェック機能を提供
• Plug-inを提供するアプリケーション(Security Application Package)には信用された署名が必要
System Libraries
Browser
Call CSF APIs
libengine.so
Content Security Framework
Installer
Security Application
Package
libengine.so
Install CSF Plugin
Fourteenforty Research Institute, Inc.
• Privilege
– TizenではAPIを3つの権限の違いで分けている
• Public - すべての開発者が利用可能
• Partner - Tizen storeのパートナー登録者のみが利用可能
• Platform - Tizenプラットフォームの管理用(一部の開発者のみ利用可能)
– 適切なPrivilegeを持たないアプリはそのAPIを呼び出せない
– Privilegeはアプリのマニフェストファイルに記述
• Feature
– Androidのパーミッションに相当する仕組み
– マニフェストファイルに利用機能(連絡先へのアクセス、カメラへのアクセスなど)を記述
– Web Runtimeは内部にAccess Control Engine(ACE)を保持
– ACEが各機能へのアクセス制限を行う
アプリの権限分離
19
Fourteenforty Research Institute, Inc.
Webアプリケーションサンドボックス
20
Kernel
Web Runtime
Web Application
JavaScript API
System Call
Web RuntimeおよびSMACKによる2段階のアクセス制御
SMACK(LSM)
SMACK Ruleのチェック
WRT Access Control Engine
Featureのチェック
仮にWeb Runtimeに脆弱性が
あっても、System Call時に許
可のないデバイス・ファイルへ
のアクセスを防げる
(すべての場合についてWRT
とSMACK Ruleのアクセス制
御が同じレベルになるかは未
調査)
Fourteenforty Research Institute, Inc.
• SMACKによるアクセス制御がセキュリティの中核
• Webアプリについては、WRTおよびSMACKによる2段階のアクセス制御
• Content Security Frameworkを提供することで、柔軟にセキュリティチェッ
ク機能を提供可能
• ネイティブコードによるアプリ開発を許可していることでバッファオーバーフ
ローなど古典的な脆弱性の可能性
• ASLR/DEPの今後改良の余地が残る
まとめ
21
Fourteenforty Research Institute, Inc.
• http://download.tizen.org/misc/media/conference2012/tuesday/ballroom
-c/2012-05-08-1600-1640-tizen_security_framework_overview.pdf
• http://download.tizen.org/misc/media/conference2012/wednesday/seacl
iff/2012-05-09-0945-1025-
understanding_the_permission_and_access_control_model_for_tizen_applicati
on_sandboxing.pdf
• http://www.youtube.com/watch?v=GtiAQOo4beg
参考資料
22

More Related Content

Viewers also liked

Héctor Martínez - Popayan
Héctor Martínez - PopayanHéctor Martínez - Popayan
Héctor Martínez - Popayan
Hector Martinez
 
At the Portal invitation
At the Portal invitationAt the Portal invitation
At the Portal invitation
Keiko Nemeth
 
"Подари улыбку"
"Подари улыбку""Подари улыбку"
"Подари улыбку"
XENIAboroda
 
How to be healthy and happy!
How to be healthy and happy!How to be healthy and happy!
How to be healthy and happy!
torrey23
 

Viewers also liked (20)

Benceno by Pamela Muso
Benceno by Pamela MusoBenceno by Pamela Muso
Benceno by Pamela Muso
 
Héctor Martínez - Popayan
Héctor Martínez - PopayanHéctor Martínez - Popayan
Héctor Martínez - Popayan
 
R city nyc v 9-24_13
R city   nyc v 9-24_13R city   nyc v 9-24_13
R city nyc v 9-24_13
 
Fase1 2 mppd
Fase1 2 mppdFase1 2 mppd
Fase1 2 mppd
 
Rader msghours 3apr15
Rader msghours 3apr15Rader msghours 3apr15
Rader msghours 3apr15
 
At the Portal invitation
At the Portal invitationAt the Portal invitation
At the Portal invitation
 
Btng chattergrids issue2
Btng chattergrids issue2Btng chattergrids issue2
Btng chattergrids issue2
 
Максимова
МаксимоваМаксимова
Максимова
 
"Подари улыбку"
"Подари улыбку""Подари улыбку"
"Подари улыбку"
 
cv03747
cv03747cv03747
cv03747
 
Horse clippers
Horse clippersHorse clippers
Horse clippers
 
How to be healthy and happy!
How to be healthy and happy!How to be healthy and happy!
How to be healthy and happy!
 
Words and phrases
Words and phrases  Words and phrases
Words and phrases
 
Ejercicio N-15
Ejercicio N-15Ejercicio N-15
Ejercicio N-15
 
Coach for Equality Booklet
Coach for Equality BookletCoach for Equality Booklet
Coach for Equality Booklet
 
Interview Nelson Lourenço - CEO on FUTURAMB
Interview Nelson Lourenço - CEO on FUTURAMBInterview Nelson Lourenço - CEO on FUTURAMB
Interview Nelson Lourenço - CEO on FUTURAMB
 
Livros para engenharia e books
Livros para engenharia e booksLivros para engenharia e books
Livros para engenharia e books
 
Nacada 2013 secret world of stem, final
Nacada 2013 secret world of stem, finalNacada 2013 secret world of stem, final
Nacada 2013 secret world of stem, final
 
Renacimiento
RenacimientoRenacimiento
Renacimiento
 
Los prof ante las innov currs
Los prof ante las innov currsLos prof ante las innov currs
Los prof ante las innov currs
 

Similar to Mr201305 tizen security_jpn

【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
Hibino Hisashi
 
スタート低レイヤー #0
スタート低レイヤー #0スタート低レイヤー #0
スタート低レイヤー #0
Kiwamu Okabe
 
Mr201210 window 8 app_container_sandbox
Mr201210 window 8 app_container_sandboxMr201210 window 8 app_container_sandbox
Mr201210 window 8 app_container_sandbox
FFRI, Inc.
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウ
chancelab
 
How security broken? - Androidの内部構造とマルウェア感染の可能性
How security broken? - Androidの内部構造とマルウェア感染の可能性How security broken? - Androidの内部構造とマルウェア感染の可能性
How security broken? - Androidの内部構造とマルウェア感染の可能性
FFRI, Inc.
 

Similar to Mr201305 tizen security_jpn (20)

Tizen native application
Tizen native applicationTizen native application
Tizen native application
 
OpenStack Swift紹介
OpenStack Swift紹介OpenStack Swift紹介
OpenStack Swift紹介
 
Hw meetup 20150304
Hw meetup 20150304Hw meetup 20150304
Hw meetup 20150304
 
【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
【DeepSecurityUserNight】我が家の箱入り娘を世間に晒すのは危険なのでDeepSecurityに見守ってもらった話
 
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
AWS Security JAWS 経済的にハニーポットのログ分析をするためのベストプラクティス?
 
FFR EXCALOC
FFR EXCALOCFFR EXCALOC
FFR EXCALOC
 
最新UE4タイトルでのローカライズ事例 (UE4 Localization Deep Dive)
最新UE4タイトルでのローカライズ事例 (UE4 Localization Deep Dive)最新UE4タイトルでのローカライズ事例 (UE4 Localization Deep Dive)
最新UE4タイトルでのローカライズ事例 (UE4 Localization Deep Dive)
 
ソニーのディープラーニングツールで簡単エッジコンピューティング
ソニーのディープラーニングツールで簡単エッジコンピューティングソニーのディープラーニングツールで簡単エッジコンピューティング
ソニーのディープラーニングツールで簡単エッジコンピューティング
 
Xcode7 / iOS 9 対応でハマったこと
Xcode7 / iOS 9 対応でハマったことXcode7 / iOS 9 対応でハマったこと
Xcode7 / iOS 9 対応でハマったこと
 
どこでも動くゲームを作るためのベタープラクティス
どこでも動くゲームを作るためのベタープラクティスどこでも動くゲームを作るためのベタープラクティス
どこでも動くゲームを作るためのベタープラクティス
 
スタート低レイヤー #0
スタート低レイヤー #0スタート低レイヤー #0
スタート低レイヤー #0
 
高速にコンテナを起動できるイメージフォーマット (NTT Tech Conference #2)
高速にコンテナを起動できるイメージフォーマット (NTT Tech Conference #2)高速にコンテナを起動できるイメージフォーマット (NTT Tech Conference #2)
高速にコンテナを起動できるイメージフォーマット (NTT Tech Conference #2)
 
Mr201210 window 8 app_container_sandbox
Mr201210 window 8 app_container_sandboxMr201210 window 8 app_container_sandbox
Mr201210 window 8 app_container_sandbox
 
Dll Injection
Dll InjectionDll Injection
Dll Injection
 
Android起動周りのノウハウ
Android起動周りのノウハウAndroid起動周りのノウハウ
Android起動周りのノウハウ
 
Yaminabe fortran
Yaminabe fortranYaminabe fortran
Yaminabe fortran
 
Spring tools4
Spring tools4Spring tools4
Spring tools4
 
How security broken? - Androidの内部構造とマルウェア感染の可能性
How security broken? - Androidの内部構造とマルウェア感染の可能性How security broken? - Androidの内部構造とマルウェア感染の可能性
How security broken? - Androidの内部構造とマルウェア感染の可能性
 
Dockerコミュニティ近況
Dockerコミュニティ近況Dockerコミュニティ近況
Dockerコミュニティ近況
 
「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12
「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12
「Python言語」はじめの一歩 / First step of Python / 2016 Jan 12
 

More from FFRI, Inc.

Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARMAppearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
FFRI, Inc.
 
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARMAppearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
FFRI, Inc.
 

More from FFRI, Inc. (20)

Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARMAppearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
 
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARMAppearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
Appearances are deceiving: Novel offensive techniques in Windows 10/11 on ARM
 
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017) TrustZone use case and trend (FFRI Monthly Research Mar 2017)
TrustZone use case and trend (FFRI Monthly Research Mar 2017)
 
Android Things Security Research in Developer Preview 2 (FFRI Monthly Researc...
Android Things Security Research in Developer Preview 2 (FFRI Monthly Researc...Android Things Security Research in Developer Preview 2 (FFRI Monthly Researc...
Android Things Security Research in Developer Preview 2 (FFRI Monthly Researc...
 
An Overview of the Android Things Security (FFRI Monthly Research Jan 2017)
An Overview of the Android Things Security (FFRI Monthly Research Jan 2017) An Overview of the Android Things Security (FFRI Monthly Research Jan 2017)
An Overview of the Android Things Security (FFRI Monthly Research Jan 2017)
 
Black Hat Europe 2016 Survey Report (FFRI Monthly Research Dec 2016)
Black Hat Europe 2016 Survey Report (FFRI Monthly Research Dec 2016) Black Hat Europe 2016 Survey Report (FFRI Monthly Research Dec 2016)
Black Hat Europe 2016 Survey Report (FFRI Monthly Research Dec 2016)
 
An Example of use the Threat Modeling Tool (FFRI Monthly Research Nov 2016)
An Example of use the Threat Modeling Tool (FFRI Monthly Research Nov 2016)An Example of use the Threat Modeling Tool (FFRI Monthly Research Nov 2016)
An Example of use the Threat Modeling Tool (FFRI Monthly Research Nov 2016)
 
STRIDE Variants and Security Requirements-based Threat Analysis (FFRI Monthly...
STRIDE Variants and Security Requirements-based Threat Analysis (FFRI Monthly...STRIDE Variants and Security Requirements-based Threat Analysis (FFRI Monthly...
STRIDE Variants and Security Requirements-based Threat Analysis (FFRI Monthly...
 
Introduction of Threat Analysis Methods(FFRI Monthly Research 2016.9)
Introduction of Threat Analysis Methods(FFRI Monthly Research 2016.9)Introduction of Threat Analysis Methods(FFRI Monthly Research 2016.9)
Introduction of Threat Analysis Methods(FFRI Monthly Research 2016.9)
 
Black Hat USA 2016 Survey Report (FFRI Monthly Research 2016.8)
Black Hat USA 2016  Survey Report (FFRI Monthly Research 2016.8)Black Hat USA 2016  Survey Report (FFRI Monthly Research 2016.8)
Black Hat USA 2016 Survey Report (FFRI Monthly Research 2016.8)
 
About security assessment framework “CHIPSEC” (FFRI Monthly Research 2016.7)
About security assessment framework “CHIPSEC” (FFRI Monthly Research 2016.7) About security assessment framework “CHIPSEC” (FFRI Monthly Research 2016.7)
About security assessment framework “CHIPSEC” (FFRI Monthly Research 2016.7)
 
Black Hat USA 2016 Pre-Survey (FFRI Monthly Research 2016.6)
Black Hat USA 2016 Pre-Survey (FFRI Monthly Research 2016.6)Black Hat USA 2016 Pre-Survey (FFRI Monthly Research 2016.6)
Black Hat USA 2016 Pre-Survey (FFRI Monthly Research 2016.6)
 
Black Hat Asia 2016 Survey Report (FFRI Monthly Research 2016.4)
Black Hat Asia 2016 Survey Report (FFRI Monthly Research 2016.4)Black Hat Asia 2016 Survey Report (FFRI Monthly Research 2016.4)
Black Hat Asia 2016 Survey Report (FFRI Monthly Research 2016.4)
 
ARMv8-M TrustZone: A New Security Feature for Embedded Systems (FFRI Monthly ...
ARMv8-M TrustZone: A New Security Feature for Embedded Systems (FFRI Monthly ...ARMv8-M TrustZone: A New Security Feature for Embedded Systems (FFRI Monthly ...
ARMv8-M TrustZone: A New Security Feature for Embedded Systems (FFRI Monthly ...
 
CODE BLUE 2015 Report (FFRI Monthly Research 2015.11)
CODE BLUE 2015 Report (FFRI Monthly Research 2015.11)CODE BLUE 2015 Report (FFRI Monthly Research 2015.11)
CODE BLUE 2015 Report (FFRI Monthly Research 2015.11)
 
Latest Security Reports of Automobile and Vulnerability Assessment by CVSS v3...
Latest Security Reports of Automobile and Vulnerability Assessment by CVSS v3...Latest Security Reports of Automobile and Vulnerability Assessment by CVSS v3...
Latest Security Reports of Automobile and Vulnerability Assessment by CVSS v3...
 
Black Hat USA 2015 Survey Report (FFRI Monthly Research 201508)
Black Hat USA 2015 Survey Report (FFRI Monthly Research 201508)Black Hat USA 2015 Survey Report (FFRI Monthly Research 201508)
Black Hat USA 2015 Survey Report (FFRI Monthly Research 201508)
 
A Survey of Threats in OS X and iOS(FFRI Monthly Research 201507)
A Survey of Threats in OS X and iOS(FFRI Monthly Research 201507)A Survey of Threats in OS X and iOS(FFRI Monthly Research 201507)
A Survey of Threats in OS X and iOS(FFRI Monthly Research 201507)
 
Security of Windows 10 IoT Core(FFRI Monthly Research 201506)
Security of Windows 10 IoT Core(FFRI Monthly Research 201506)Security of Windows 10 IoT Core(FFRI Monthly Research 201506)
Security of Windows 10 IoT Core(FFRI Monthly Research 201506)
 
Trend of Next-Gen In-Vehicle Network Standard and Current State of Security(F...
Trend of Next-Gen In-Vehicle Network Standard and Current State of Security(F...Trend of Next-Gen In-Vehicle Network Standard and Current State of Security(F...
Trend of Next-Gen In-Vehicle Network Standard and Current State of Security(F...
 

Mr201305 tizen security_jpn

  • 1. Fourteenforty Research Institute, Inc. 1 Tizenセキュリティ Fourteenforty Research Institute, Inc. 株式会社 フォティーンフォティ技術研究所 http://www.fourteenforty.jp シニア・リサーチ・エンジニア 鈴木 秀一郎
  • 2. Fourteenforty Research Institute, Inc. • iOS, Androidに代わる新たスマートフォン・タブレットOSとして、TizenやFirefox OS が注目されている • 国内でも、年内か来年にはTizen OS搭載の端末がリリースされるとの情報 • Androidもリリース以降、常にセキュリティ面は注目されてきた • 新たなOSのセキュリティはどうなのだろうか? • 今回はTizenのセキュリティについて調査 • Tizen SDK 2.1のエミュレータを用いて調査 背景 2
  • 3. Fourteenforty Research Institute, Inc. • 概要 – モバイルデバイス向けオープンソースOS – Linux Foundationのプロジェクトの一つ – サムスン電子とインテルによって主導されている • 特徴 – Linuxベース – Tizen 2.0からはWebおよびNative(C/C++)でのアプリ開発をサポート Tizen概要 3
  • 4. Fourteenforty Research Institute, Inc. Tizenアーキテクチャ 4 http://upload.wikimedia.org/wikipedia/commons/c/c3/What_is_tizen_architecture.pngより転載 WebおよびNativeアプリをともにサポート
  • 5. Fourteenforty Research Institute, Inc. • 二つのパッケージフォーマット – Tizen Package (.tpk) : Native Applications – Tizen Web Package (.wgt) : Web Applications Tizen Package 5
  • 6. Fourteenforty Research Institute, Inc. • インストール先は /opt/apps/(AppId) • AppIdは10バイトの文字列 • /opt/apps/(AppId)下は – bin/ – data/ – res/ などが含まれる Tizen アプリ Web/Native 共通事項 6
  • 7. Fourteenforty Research Institute, Inc. Tizen Web package 7 https://developer.tizen.org/documentation/articles/tizen-application-packaging-overviewより引用 • 拡張子 .wgt を持つZipアーカイブ • .wgtファイルは以下の図の赤枠内の構造を持つ • binディレクトリ下にWeb Runtime(WRT)へのシンボリックリンクが作成される • 起動時にはこのファイルが実行されWebアプリをホストする
  • 8. Fourteenforty Research Institute, Inc. • 拡張子 .tpk を持つZipアーカイブ • .tpkファイルはAppId下の構造をそのまま持つ • binディレクトリ下に直接Nativeコードのバイナリが配置される Tizen Native package 8 https://developer.tizen.org/documentation/articles/tizen-application-packaging-overviewより引用
  • 9. Fourteenforty Research Institute, Inc. セキュリティ 9 • 以下の項目について、調査 – OSレベルのセキュリティ • アクセス制御 • 脆弱性攻撃防御 • Content Security Framework – アプリの権限分離 • Privileges • Feature
  • 10. Fourteenforty Research Institute, Inc. アクセス制御概要 10 • すべてのプロセスは以下の二つのユーザーで動作 – root – app • Webアプリ、NativeアプリともにUID “app”で動作 • SMACKによる強制アクセス制御 – すべてのアプリはSmackでラベルづけされる
  • 11. Fourteenforty Research Institute, Inc. 2つのUIDの利用 11 Kernel Web App1 Web Runtime (UID: app) Web App2 Native App (UID: app) Service (UID: root) UID appで動作 高い権限の必要な サービス類は rootで動作
  • 12. Fourteenforty Research Institute, Inc. アプリ同士の分離 12 アプリはすべてUID “app”で動作 ↓ アプリ同士は互いのファイルへアクセス可能?? SMACKによるアクセス制御 (アプリ同士はデフォルトで干渉不可)
  • 13. Fourteenforty Research Institute, Inc. • LSM(Linux Security Modules)の一つ • Subject (≒プロセス)と Object (≒ファイル)にラベルを付け、ラベル間のア クセスルールを書くことでアクセス制御を行う • アクセスルール例: SMACK 13 ラベル“TopSecret”を持つSubjectは TopSecret Secret rx ラベル“Secret”を持つObjectに 読み取り、実行可能
  • 14. Fourteenforty Research Institute, Inc. SMACK Labelの利用 14 Kernel Web App1 Web Runtime (UID: app) Web App2 Native App1 (UID: app) Service1 (UID: root) UID appで動作 高い権限の必要な サービス類は rootで動作 WebApp1 SMACK Label WebApp2 NativeApp1 File1 WebApp1 File2 WebApp2 WebApp2ラベルを持つ ファイルへはアクセス不可 Service1
  • 15. Fourteenforty Research Institute, Inc. 脆弱性防御 15 • Tizen 2.0からNative (C/C++)によるアプリ開発をサポート • 典型的なバッファオーバーフロー脆弱性の可能性 • ASLR および DEPが基本対策
  • 16. Fourteenforty Research Institute, Inc. DEP 16 • 以下のコードをTizen Native Applicationとして実行 int func(){ int a = 10; int b = 20; return a+b; } _EXPORT_ int OspMain(int argc, char *pArgv[]) { AppLog("Application started."); char buf[1024]; int (*f)(); memcpy( buf, (char*)func, 1024); f = (int (*)())buf; int b = f(); ArrayList args(SingleObjectDeleter); args.Construct(); ….. スタックにバッファを用意 スタックにfuncをコピー スタック上のコードを実行 特に問題なく動作 DEPは無効 (Tizen SDK 2.1 x86 Emulator上にて)
  • 17. Fourteenforty Research Institute, Inc. ASLR 17 • /proc/sys/kernel/randomize_va_space は 2 = ASLR有効であるという意味 • 実際には…(Tizen Native Appを用いてエミュレータで確認) – 同じプログラムを2回起動。/proc/[pid]/mapsの主要なモジュール、ヒープ、ス タックのアドレスは2回とも結果は変化なし → ランダマイズされていない(Tizen SDK 2.1 x86 Emulator上にて) • /proc/self/personalityの値が 00040000 (ADDR_NO_RANDOMIZE) – ASLRはこれによって無効化されている 09e0e000-09e70000 rw-p 00000000 00:00 0 [heap] 09e70000-09f80000 rw-p 00000000 00:00 0 [heap] b36e7000-b36ec000 r-xp 00000000 fe:00 73077 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7.exe b36ec000-b36ed000 rw-p 00004000 fe:00 73077 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7.exe b36ed000-b36f0000 r-xp 00000000 fe:00 73094 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7 b36f0000-b36f1000 rw-p 00002000 fe:00 73094 /opt/usr/apps/hNLQmS2Kl0/bin/MySample7 bfdcf000-bfdf0000 rw-p 00000000 00:00 0 [stack]
  • 18. Fourteenforty Research Institute, Inc. Applications Content Security Framework(CSF) 18 • Tizenにセキュリティチェック機能を柔軟に提供できるようにする仕組み • CSFはAPIおよびPlug-inのインターフェースを規定 • セキュリティチェック機能はPlug-in (libengine.so)として提供 • Plug-inはファイル、URL、Webサイト(HTML, JavaScript)などのチェック機能を提供 • Plug-inを提供するアプリケーション(Security Application Package)には信用された署名が必要 System Libraries Browser Call CSF APIs libengine.so Content Security Framework Installer Security Application Package libengine.so Install CSF Plugin
  • 19. Fourteenforty Research Institute, Inc. • Privilege – TizenではAPIを3つの権限の違いで分けている • Public - すべての開発者が利用可能 • Partner - Tizen storeのパートナー登録者のみが利用可能 • Platform - Tizenプラットフォームの管理用(一部の開発者のみ利用可能) – 適切なPrivilegeを持たないアプリはそのAPIを呼び出せない – Privilegeはアプリのマニフェストファイルに記述 • Feature – Androidのパーミッションに相当する仕組み – マニフェストファイルに利用機能(連絡先へのアクセス、カメラへのアクセスなど)を記述 – Web Runtimeは内部にAccess Control Engine(ACE)を保持 – ACEが各機能へのアクセス制限を行う アプリの権限分離 19
  • 20. Fourteenforty Research Institute, Inc. Webアプリケーションサンドボックス 20 Kernel Web Runtime Web Application JavaScript API System Call Web RuntimeおよびSMACKによる2段階のアクセス制御 SMACK(LSM) SMACK Ruleのチェック WRT Access Control Engine Featureのチェック 仮にWeb Runtimeに脆弱性が あっても、System Call時に許 可のないデバイス・ファイルへ のアクセスを防げる (すべての場合についてWRT とSMACK Ruleのアクセス制 御が同じレベルになるかは未 調査)
  • 21. Fourteenforty Research Institute, Inc. • SMACKによるアクセス制御がセキュリティの中核 • Webアプリについては、WRTおよびSMACKによる2段階のアクセス制御 • Content Security Frameworkを提供することで、柔軟にセキュリティチェッ ク機能を提供可能 • ネイティブコードによるアプリ開発を許可していることでバッファオーバーフ ローなど古典的な脆弱性の可能性 • ASLR/DEPの今後改良の余地が残る まとめ 21
  • 22. Fourteenforty Research Institute, Inc. • http://download.tizen.org/misc/media/conference2012/tuesday/ballroom -c/2012-05-08-1600-1640-tizen_security_framework_overview.pdf • http://download.tizen.org/misc/media/conference2012/wednesday/seacl iff/2012-05-09-0945-1025- understanding_the_permission_and_access_control_model_for_tizen_applicati on_sandboxing.pdf • http://www.youtube.com/watch?v=GtiAQOo4beg 参考資料 22