30.04.2013 Views

Sticky Broadcasts - owasp

Sticky Broadcasts - owasp

Sticky Broadcasts - owasp

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Software Security<br />

Goes Mobile<br />

Jacob West<br />

CTO, Fortify Products<br />

HP Enterprise Security<br />

July 12, 2012


Motivation<br />

Redefining the phone and the computer<br />

Money: Beyond ringtones and 99¢ games


Landscape<br />

3<br />

What is mobile?<br />

What matters?<br />

Who cares?


Mobile Threats<br />

4<br />

Seven ways to<br />

hang yourself<br />

with Google Android


5<br />

Parting Thoughts<br />

Questions you can ask<br />

to begin improving your<br />

mobile security today


Motivation


Smartphones > Feature Phones<br />

6<br />

140<br />

10<br />

150 149<br />

21<br />

Smartphone Feature Phone<br />

38<br />

140 140<br />

51<br />

2005 2006 2007 2008 2009 2010E 2011E 2012E 2013E<br />

71<br />

108<br />

93<br />

Source: Morgan Stanley Research<br />

90<br />

119<br />

67<br />

154<br />

34


Smartphones > PCs<br />

100%<br />

90%<br />

80%<br />

70%<br />

60%<br />

50%<br />

40%<br />

30%<br />

20%<br />

10%<br />

0%<br />

2005 2006 2007 2008 2009 2010E 2011E 2012E 2013E<br />

Smartphones Laptops Desktops<br />

Source: Morgan Stanley Research


Page Views on the Rise<br />

½<br />

?<br />

Source: Morgan Stanley Research<br />

2<br />

3½<br />


Mobile Opportunities<br />

Please select the most important benefit that your organization ultimately expects to gain from current or<br />

future mobile solutions deployments (whether or not you are currently receiving those benefits)<br />

Improve/enhance worker productivity<br />

Increased sales/revenue<br />

Improve field service response time<br />

Competitive advantage/market share<br />

Provide ease of information access<br />

Improve customer service<br />

Decreased costs<br />

Offer employees more flexibility<br />

Enhance portability within the office<br />

Eliminate paperwork<br />

Speed the sales process<br />

Provide perception of an advanced company<br />

N = 600, Source: IDC’s Mobile Enterprise Software Survey (2011)<br />

0 5 10 15 20 25 30


% of purchasers<br />

Mobile Purchasers<br />

50<br />

45<br />

40<br />

35<br />

30<br />

25<br />

20<br />

15<br />

10<br />

5<br />

0<br />

$300/year<br />

per user<br />

Source: Google The Mobile Movement Study


Why Mobile Users Don’t Buy<br />

§ Security is #2 reason to avoid purchases


Mobile Landscape


What is Mobile?<br />

device<br />

connection<br />

server<br />

os


Familiar Model<br />

device<br />

browser<br />

server


Same Ol’ Server<br />

Information<br />

Operations Software<br />

Security Services


Client-Side Persistence<br />

Alex<br />

******<br />

321-15-5124<br />

§ Local data persistence<br />

§ Similar to HTML 5<br />

§ Invisible to users<br />

and always available


Mobile OS<br />

§ Benefit of hindsight<br />

§ Security features<br />

- Read-only stack<br />

- Data encryption<br />

- Permissions<br />

§ Confusing<br />

- Wait, permissions?


Can’t We All Get Along?<br />

§ Formal communication<br />

- Inter-application<br />

- Intra-application<br />

- With the OS<br />

§ A new trust boundary


What Matters?<br />

Old<br />

§ Handling sensitive<br />

user and app data<br />

§ Environment and<br />

configuration<br />

§ Standbys like XSS<br />

and SQL injection<br />

New<br />

§ Local storage<br />

(e.g. SD card)<br />

§ Communication<br />

(SMS, MMS, GPS)<br />

§ Security features<br />

(Privileges, crypto)


Who Cares?<br />

Device<br />

Builders<br />

App<br />

Owners<br />

App<br />

Developers<br />

OS<br />

Users<br />

Authors Network<br />

Providers


Mobile Threats


Google Android Vulnerabilities<br />

1 Intent Hijacking<br />

2 Intent Spoofing<br />

3 <strong>Sticky</strong> Broadcast Tampering<br />

4 Insecure Storage<br />

5 Insecure Network Communication<br />

6 SQL Injection<br />

7 Promiscuous Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

Description: Malicious app intercepts an intent bound for another app to compromise<br />

data or alter behavior<br />

Cause: Implicit intents (do not require strong permissions to receive)<br />

Fix: Explicit intents and receiver permissions<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

IMDb App<br />

Showtime<br />

Search<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Results UI<br />

Implicit Intent<br />

Action: willUpdateShowtimes<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Handles Actions:<br />

willUpdateShowtimes,<br />

showtimesNoLocationError<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

IMDb App<br />

Showtime<br />

Search<br />

Eavesdropping App<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Results UI<br />

Implicit Intent<br />

Action: willUpdateShowtimes<br />

Malicious<br />

Receiver<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Handles Actions:<br />

willUpdateShowtimes,<br />

showtimesNoLocationError<br />

Handles Actions:<br />

willUpdateShowtimes,<br />

showtimesNoLocationError<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

Description: Malicious app spoofs a legitimate intent to inject data or alter behavior<br />

Cause: Public components (necessary to receive implicit intents)<br />

Fix: Explicit intents and receiver permissions<br />

Sensitive operations in private components<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

Spoofing App<br />

IMDb App<br />

Showtime<br />

Search<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Action: showtimesNoLocationError<br />

Results UI<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Malicious<br />

Component<br />

Handles Actions:<br />

willUpdateShowtimes,<br />

showtimesNoLocationError<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Description: Persistent intents can be accessed and removed by malicious apps<br />

Cause: BROADCAST_STICKY allows to full access to any sticky broadcasts<br />

Fix: Explicit, non-sticky broadcasts and receiver permissions<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

<strong>Sticky</strong> <strong>Broadcasts</strong> (intents) Malicious App<br />

SB1<br />

SB2 ?<br />

SB3<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

Requests<br />

BROADCAST_STIC<br />

KY Permission<br />

Victim App<br />

Receiver<br />

(expects SB2)<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Description: Local storage visible to attackers and can compromise sensitive data<br />

Cause: Local files are world-readable and persist<br />

Insecure<br />

Network<br />

Communication<br />

Fix: Use SQLite or internal storage for private data<br />

Encrypt the data (keep keys off the SD)<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

§ Kindle app saves ebooks<br />

(.mbp and .prc) in<br />

a folder on the SD card<br />

§ Depending on DRM,<br />

accessible to other apps<br />

§ Saves covers of books<br />

(privacy violation)<br />

§ Folder is retained after<br />

uninstall of app<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Description: Unencrypted channels can be intercepted by attackers sniffing network<br />

Cause: Non-HTTPS WebView connections<br />

Insecure<br />

Network<br />

Communication<br />

Fix: Send sensitive data only over encrypted channels<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

Twitter: Tweets are sent in the clear<br />

https://freedom-to-tinker.com/blog/dwallach/things-overheard-wifi-my-android-smartphone<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges<br />

Facebook: Despite ‘fully encrypted’ option on<br />

the Web, mobile app sends in the clear


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Description: Malicious users alter or view (query string injection) database records<br />

Cause: Untrusted data used to construct a SQL query or clause<br />

Fix: Parameterized queries<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

c = invoicesDB.query(<br />

);<br />

Intent Spoofing<br />

Uri.parse(invoices),<br />

columns,<br />

"productCategory = '" +<br />

productCategory + "' and<br />

customerID = '" + customerID + "'",<br />

null, null, null,<br />

"'" + sortColumn + "'",<br />

null<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

productCategory = Fax Machines<br />

customerID = 12345678<br />

sortColumn = price<br />

Select * from invoices<br />

where productCategory = ‘ Fax Machines'<br />

and customerID = '12345678'<br />

order by 'price'<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

productCategory = Fax Machines' or productCategory = \"<br />

customerID = 12345678<br />

sortColumn = \" order by ‘price<br />

select * from invoices<br />

where productCategory = 'Fax Machines'<br />

or productCategory = “ ‘<br />

and customerID = ‘ 12345678 ' order by ‘ "<br />

order by 'price'<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

c = invoicesDB.query(<br />

);<br />

Intent Spoofing<br />

Uri.parse(invoices),<br />

columns,<br />

"productCategory = ? and customerID = ?",<br />

{productCategory, customerID},<br />

null,<br />

null,<br />

"sortColumn = ?",<br />

sortColumn<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Description: Extra permissions permit privilege escalation and desensitizes users<br />

Cause: Deputies,<br />

Artifacts from testing,<br />

Confusion (inaccurate/incomplete resources)<br />

Fix: Identify unnecessary permissions<br />

Insecure<br />

Network<br />

Communication<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

User App<br />

Does NOT need CAMERA<br />

permission<br />

Wants Picture<br />

Implicit Intent<br />

Action:<br />

IMAGE_CAPTURE<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

Insecure<br />

Network<br />

Communication<br />

Camera App<br />

Needs CAMERA<br />

permission<br />

Takes<br />

Picture<br />

Handles Action:<br />

IMAGE_CAPTURE<br />

SQL Injection<br />

Promiscuous<br />

Privileges


Google Android Vulnerabilities<br />

Intent Hijacking<br />

Intent Spoofing<br />

<strong>Sticky</strong><br />

Broadcast<br />

Tampering<br />

Insecure<br />

Storage<br />

§ Third hit on Google search<br />

Insecure<br />

Network<br />

Communication<br />

Not true for android.net.wifi.STATE_CHANGE<br />

SQL Injection<br />

http://stackoverflow.com/questions/2676044/broadcast-intent-when-network-state-has-changend<br />

Promiscuous<br />

Privileges


Empirical Results: DEFCON ‘11<br />

Vulnerability Type % of Apps<br />

1. Intent Hijacking 50%<br />

2. Intent Spoofing 40%<br />

3. <strong>Sticky</strong> Broadcast Tampering 6%<br />

4. Insecure Storage 28%<br />

5. Insecure Communication N/A<br />

6. SQL Injection 17%<br />

7. Promiscuous Privileges 31%


Bonus: iGoat<br />

§ iGoat 1.0 documents 5 vulnerabilities<br />

- We find 15+<br />

§ iGoat 1.2 documents 7 vulnerabilities<br />

- We find 20+


Parting Thoughts


What Questions to Ask?<br />

§ What do your apps do and for whom?<br />

§ What platform(s) do your apps support and how?<br />

§ Who develops your apps and where?<br />

§ Is there an existing SDL for other development?<br />

§ Do you rely on platform providers or app<br />

distributors for any security assurance?<br />

§ Are mobile apps prompting back-end changes?<br />

§ Are your apps appropriately permissioned?


Software Security<br />

Goes Mobile<br />

Jacob West<br />

CTO, Fortify Products<br />

HP Enterprise Security<br />

July 12, 2012

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!