vs. When Security is not a Developer's fault. Rodrigo Chiossi - - PowerPoint PPT Presentation

vs
SMART_READER_LITE
LIVE PREVIEW

vs. When Security is not a Developer's fault. Rodrigo Chiossi - - PowerPoint PPT Presentation

vs. When Security is not a Developer's fault. Rodrigo Chiossi r.chiossi@samsung.com Rodrigo Chiossi Android Builders Summit 2013 AndroidXRef : One year ago Online source code cross reference of the Android source code. All major


slide-1
SLIDE 1

Rodrigo Chiossi

Android Builders Summit 2013

vs.

When Security is not a Developer's fault.

Rodrigo Chiossi r.chiossi@samsung.com

slide-2
SLIDE 2

Rodrigo Chiossi

Android Builders Summit 2013

AndroidXRef: One year ago…

  • Online source code cross reference of the Android

source code.

  • All major Android versions available.
  • Average 10K page views per day.

www.androidxref.com

slide-3
SLIDE 3

Rodrigo Chiossi

Android Builders Summit 2013

SIDI: Samsung's Research Lab

  • Main Mobile Research Lab in Latin America.
  • Focused on Smartphone research.
  • Strong research on Mobile Security.

– Focus on offensive security.

slide-4
SLIDE 4

Rodrigo Chiossi

Android Builders Summit 2013

Security Targets

  • Kernel
  • File System
  • Android Platform
  • Android Applications
slide-5
SLIDE 5

Rodrigo Chiossi

Android Builders Summit 2013

Apps Analyzed

  • Pre-Loaded Apps

– Samsung Apps – Partner Apps

  • Non Pre-Loaded Apps

– Samsung Apps – Partner Apps – Popular “critical” apps.

slide-6
SLIDE 6

Rodrigo Chiossi

Android Builders Summit 2013

26,67% 19,05% 10,48% 9,52% 6,67% 5,71% 4,76% 3,81% 3,81% 3,81% 2,86% 2,86%

Vulnerability Frequency Chart

Open Broadcast Receiver Improper SSL Handling Open Service Hardcoded Crypto key Improper SMS Handling Unencrypted Data over Network Improper Filesystem Permissions Open Content Provider Unprotected Socket Information Leak in logcat Unprotected data in DB Unprotected Intent

slide-7
SLIDE 7

Rodrigo Chiossi

Android Builders Summit 2013

Open Broadcast Receivers

  • Occurs when the Broadcast Receiver does not

check the source of the intent it received.

  • Not usually the intended behavior during

development

  • Most common use case is to export the broadcast

receiver only to a restricted context.

– E.g. Another app from the same developer.

slide-8
SLIDE 8

Rodrigo Chiossi

Android Builders Summit 2013

Default Behavior

  • Restricted to the App only

– Good design choice. – Covers the most common use case of Broadcast Receivers.

  • When Exported:

– Default behavior is to be open to everybody. – Not the most common use case.

slide-9
SLIDE 9

Rodrigo Chiossi

Android Builders Summit 2013

Protection Mechanism

  • Protect the Broadcast Receiver with a permission.
slide-10
SLIDE 10

Rodrigo Chiossi

Android Builders Summit 2013

Implementation Flow

Declare Broadcast Receiver Export the Receiver Unprotected Protect the Receiver

  • Proper Implementation Flow

Declare Broadcast Receiver Try to access it from another app and fails Look for a solution at StackOverflow Export the Receiver Unprotected Try to access it from another app and succeed

  • Developer Implementation Flow
slide-11
SLIDE 11

Rodrigo Chiossi

Android Builders Summit 2013

Implementation Flow

Declare Broadcast Receiver Export the Receiver Unprotected Protect the Receiver

  • Proper Implementation Flow

Declare Broadcast Receiver Try to access it from another app and fails Look for a solution at StackOverflow Export the Receiver Unprotected Try to access it from another app and succeed

  • Developer Implementation Flow
slide-12
SLIDE 12

Rodrigo Chiossi

Android Builders Summit 2013

Implementation Flow

Declare Broadcast Receiver Export the Receiver Unprotected Protect the Receiver

  • Current Implementation Flow
  • Healthy Implementation Flow

Declare Broadcast Receiver Export the Receiver Protected Unprotect the Receiver

slide-13
SLIDE 13

Rodrigo Chiossi

Android Builders Summit 2013

Implementation Flow

Declare Broadcast Receiver Export the Receiver Protected Unprotect the Receiver

  • Proper Implementation Flow

Declare Broadcast Receiver Try to access it from another app and fails Look for a solution at StackOverflow Export the Receiver Protected Try to access it from another app and succeed

  • Developer Implementation Flow
slide-14
SLIDE 14

Rodrigo Chiossi

Android Builders Summit 2013

Other applications

  • The concept can be applied to other scenarios:

– Open Services – Open Content Providers

  • In both scenarios the developer reaches the

unprotected state before the protected state.

slide-15
SLIDE 15

Rodrigo Chiossi

Android Builders Summit 2013

Improper SSL Handling

  • Occurs when the developer validates a self-signed

certificate with an empty TrustManager. E. g. :

  • Lack of proper documentation and confusing API.
  • New version of Android (4.2) already address that

issue, but still needs improvement.

slide-16
SLIDE 16

Rodrigo Chiossi

Android Builders Summit 2013

The rest of the chart…

  • Other security issues in the chart are developers

faults!

  • Very bad common habits:

– Hardcode the crypto key in the application – Trust SMS data to perform critical operations

slide-17
SLIDE 17

Rodrigo Chiossi

Android Builders Summit 2013

The hidden issue: Excessive Permissions

  • Hard to measure with manual assessment.
  • Does not introduce a security flaw, but potentialize

the risk is one is present.

  • The Pwn2Own case:

– Platform signed application with INSTALL_PACKAGES permission. – INSTALL_PACKAGES permission was not required. – Enabled an attack to that app to install malicious app in the device.

slide-18
SLIDE 18

Rodrigo Chiossi

Android Builders Summit 2013

Permission Declaration Flow

Use a permission restricted API The application crashes Look for a solution

  • nline

Paste in the app manifest all the permissions he found. The application runs successfully

  • Developer Implementation Flow
slide-19
SLIDE 19

Rodrigo Chiossi

Android Builders Summit 2013

Proper Permission Declaration

  • A mapping of API-Permission must exist.
  • Automate permission declaration for know APIs at

compile time.

  • Allow for manually add custom permission for

unknown APIs.

slide-20
SLIDE 20

Rodrigo Chiossi

Android Builders Summit 2013

To Sum Up…

  • Not every security issue is a developer's fault.
  • It is possible to act directly on the platform to

avoid common security problems.

  • The developer should always go through the

secure state before he is able to reach the insecure state.

slide-21
SLIDE 21

Rodrigo Chiossi

Android Builders Summit 2013

Rodrigo Chiossi r.chiossi@samsung.com r.chiossi@androidxref.com

?