Security Best Practices for Mobile Development @ Dreamforce 2013


Published on

The slide deck from my Mobile Security session from Dreamforce 2013

Published in: Technology
No Downloads
Total Views
On Slideshare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • No system is perfectly secure
    Security is all about managing risk
  • Something that allows an attack to take place.
    To use credit cards, we frequently have to let them out of our sight
  • Someone we give our credit card to could skim it
  • Reduces the severity of one (or more) of the three
    Laws and credit card company policies limit our liability to $50 (by law) or frequently $0 (by policy)
    The vulnerability and threat still exist, but the consequence is nullified (for the consumer, anyway)
  • Separation of Concerns: Apps, modules, etc. are separated – each module has a specific function
    Principle of Least Privilege – Each of these modules has only the permissions necessary to do its legitimate function
  • CIA applies to:
    Application Security – Up to the developer
    Operating System Security – Sandboxing, permissions
    Device Security – PIN, Hardware Encryption
    Infrastructure Security – Codesigning, app store reviews, etc.
  • Would not be possible today because of DEP
    ASLR: Address Space Layout Randomization
    DEP: Data Execution Protection
  • iOS 4.3+, Android ICS (broken), Jelly Bean (fixed)
    ASLR: Address Space Layout Randomization
    DEP: Data Execution Protection
  • META-INF checksums – keep would-be hackers from modifying files in the APK after it’s been signed
    Files of the same name
    Checks first, installs last
  • 2009
    SMS is an excellent attack vector – no way to turn it off, no way to firewall it. It’s used to make the phone ring in addition to text messages, so it’s a wide open port on all phones
    Attack exploited the fact that the start of a concatenated SMS message tells the phone how many individual 140 byte messages to expect – no messages are displayed until all are received
  • Another Charlie Miller exploit – presented at Black Hat, July 25 2012
    NFC tag can launch any URL in the browser – makes use of known WebKit exploit to take over the phone.
    Doesn’t require user to give permission to launch the URL
    Biggest threat is someone placing a rogue NFC tag on/near a legitimate NFC reader
  • But my phone’s encrypted!
  • 128 bit / 256 bit really only makes a difference if password is greater than 16 characters (16*8=128)
    With a PIN/Passcode, Email, Attachments, and some other system files are encrypted while device is locked
    Any other app is storing the keys with the lock unless app specifies NSFileProtectionComplete
  • on official App Store / Marketplace, all apps are digitally signed by the developer – ties malware back to an individual or company
    -- With iOS, Apple is the Certificate Authority. With Android, self-signed certificates are acceptable.
  • applications are limited in what they can access with regards to other applications or system resources
    limits damage that can be done by exploiting any one app
  • What’s new in iOS 7:
    App States and Multitasking:
  • One of the biggest security concerns people have with Android is that they know apps can run in the background, and they can interact with other apps
  • Activities
    Content Provider
    Broadcast Receiver
  • “Except passwords”?
  • Android apps need to specify which system resources they need access to
    Users accept these when they install the app
  • Some things you can do, but none are 100% reliable.
  • Security Best Practices for Mobile Development @ Dreamforce 2013

    1. Security Best Practices for Mobile Development Tom Gersic, Director, Mobile Services Delivery @tomgersic
    2. Safe harbor Safe harbor statement under the Private Securities Litigation Reform Act of 1995: This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services. The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site. Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available., inc. assumes no obligation and does not intend to update these forward-looking statements.
    3. Tom Gersic Director, Mobile Services Delivery @tomgersic
    4. Agenda • Fundamental Principles • What iOS and Android Share • iOS Specific Characteristics • Android Specific Characteristics • Salesforce Mobile Offerings
    5. Who thinks the data on their phone is secure?
    6. Everything on my iPhone is encrypted because I use a PIN code. Is this a true Statement?
    7. Anybody here use Facebook?
    8. Improved in iOS7, though
    9. What about Salesforce 1?
    10. Fundamental Security Principles
    11. Vulnerability
    12. Threat
    13. Consequence
    14. Mitigation
    15. Separation of Concerns – Principle of Least Privilege
    16. Security Stack
    17. Real life examples
    18. Libtiff Image Exploit / Jailbreak • iPhone 1 – patched in 1.1.2 • Tiff buffer overflow • Nothing to prevent executing code on the heap • Gained root access from viewing an image on the web
    19. ASLR (PIE) and DEP
    20. iOS 7 Lock Screen Bypass
    21. Fingerprint Hacking
    22. “Bluebox uncovers Android Master Key -- 2013”
    23. Concatenated SMS Exploit – Charlie Miller
    24. Concatenated SMS Exploit • Takes 519 SMS messages – all but 1 is invisible • Send message -1 of X to underflow the array buffer • Can’t be stopped by the user • Used to write an entire binary executable to the heap, and run it, taking over the phone.
    25. NFC Exploit
    26. But most of the time…
    27. Data Security – Hardware Encryption Requires PIN/Passcode on both iOS and Android On iOS, apps opt-in Supported on  iPhone 3GS w/ iOS v4+ (AES 256 bit)  Android Honeycomb+ (AES 128 bit) • Some manufacturers increase to AES 256 bit (Samsung SAFE) SD Card encryption on Android is manufacturer specific.
    28. App Security
    29. Layers of Defense
    30. Application Signing
    31. Application Sandboxing
    32. iOS Sandbox • All apps (Apple’s and App Store) run as “mobile” user. • Sandboxing is bolted on -- handled via XNU Sandbox “Seatbelt” kernel extension. • Applications run in separate subdirectories of /private/var/mobile/Applications • Any app in this directory is loaded with “container” (sandboxed) profile.
    33. Android Sandbox • Uses underlying Linux security model • Every app runs as a separate user • Apps signed by the same developer can run as the same user, if desired (not the default, though) • Every app runs in its own instance of the Android Runtime (Dalvik Virtual Machine) • Like iOS, every app has its own directory structure • SD Card, though, is generally public – accessible to all apps and unencrypted unless manufacturer has added encryption (Samsung SAFE)
    34. Background Processing
    35. iOS 7 Backgrounding
    36. Background Processes / App Interaction
    37. Types of Android Components  Activities  Intent  Service  Content Provider  Broadcast Receiver
    38. Public / Private Components
    39. But what about custom keyboards?
    40. Keyboard Security Risks
    41. Except Passwords?
    42. Permissions
    43. Mitigation
    44. Static Analysis Tools
    45. Application Encryption • Encrypt your data yourself using PIN / Passcode • CoreData/SQLCipher  NSIncrementalStore  Good Dynamics • FMDB/SQLCipher  Salesforce Smartstore
    46. Jailbreak Detection • Sandbox integrity check: fork() should fail • Check for jailbreak files:  /Applications/  /Library/MobileSubstrate/MobileSubstrate.dylib  /var/cache/apt  /bin/sh  /bin/bash
    47. In-App Encryption
    48. Mobile SDK Customer Data
    49. SmartStore Stack
    50. Enable ASLR in your app • ASLR: Address Space Layout Randomization
    51. Stack Canaries • AKA Stack Smashing Protection • Protect against buffer overflows • Places random known value (canary) before local variables • Use Apple LLVM – won’t work with LLVM GCC
    52. Hide Data from App Snapshot Images
    53. Who STILL thinks the data on their phone is secure?
    54. Tom Gersic Director, Mobile Services Delivery @tomgersic
    55. @tomgersic
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.