17
Building Secure Android Apps Kaushal Bhavsar

Building secure android apps

Embed Size (px)

Citation preview

Page 1: Building secure android apps

Building Secure Android AppsKaushal Bhavsar

Page 2: Building secure android apps

Who am I?

• Kaushal Bhavsar• Founder & CEO, Pratikar Technologies• Visiting Faculty, Dept. of Computer Science, (Rollwala) – Network Security in MCA V

• Pursuing PhD from CHARUSAT– Computer Security

Page 3: Building secure android apps

Know this App??

Page 4: Building secure android apps

Similar Apps

Falling Down Super Guitar Solo

Super History Eraser

Photo Editor Super Ringtone Maker Chess

下坠滚球_Falldown

Falling Ball Dodge

Page 5: Building secure android apps

Basics

Vulnerability

ThreatRisk

Page 6: Building secure android apps

Basics - II

Attack Surface

Defense-in-depth

Least Privilege

Page 7: Building secure android apps

Android Architecture

Linux Kernel

Native Libraries

Application Framework

Your Apps

Page 8: Building secure android apps

Android Security Model

Application Isolation

Application Signing

Filesystem Isolation

Page 9: Building secure android apps

Application Isolation

• When an app is installed, it gets a new UID.• All data stored by that application is assigned

that same UID• All resources for that app are given full

permissions for the app’s UID. • Different UIDs can not access each other’s

data.

Page 10: Building secure android apps

Filesystem Isolation

• All data for the app is stored in /data/data/app_package_name

• Only UID for specific app can access it• Apps with same UIDs can access each other’s

data• Root UID can access all apps’ data!• SD Card data is not protected!• Files created using apps MUST be have

appropriate permissions

Page 11: Building secure android apps

Data Security

Stored Data Mobile Data

Page 12: Building secure android apps

Protecting Stored Data

Cryptography

Hashing Encryption

Symmetric Asymmetric

Page 13: Building secure android apps

Protecting Mobile Data

Figure from http://technet.microsoft.com

Page 14: Building secure android apps

Input Validation

Accept

Known

Good

Reject Known Bad

Page 15: Building secure android apps

Command InjectionSQLiteDatabase db = dbHelper.getWriteableDatabase();

String userQuery = "SELECT lastName FROM useraccounts WHERE userID = " + request.getParameter("userID");

SQLiteStatement prepStatement = db.compileStatement(userQuery);

String userLastname = prepStatement.simpleQueryForString();

Page 16: Building secure android apps

SQLiteDatabase db = dbHelper.getWriteableDatabase();

String userQuery = "SELECT lastName FROM useraccounts WHERE userID = ?";

SQLiteStatement prepStatement = db.compileStatement(userQuery);

prepStatement.bindString(1, request.getParameter("userID"));

String userLastname = prepStatement.simpleQueryForString();

Page 17: Building secure android apps

Thank you!

[email protected]