Share
Embed
Common iOS Vulnerabilities and How to Fixย Them
Julia Mezher
May 17, 2021
Transcript
63 slides
-
Security Software Engineer @julepka We help companies to protect their
sensitive and valuable data. -
How do we know the vulnerability is common? OWASP Mobile
Top 10 CVE-List by MITRE Security tools/services vendors News and Twitter ๐ Our own experience ๐ -
OWASP Mobile Top 10 M1: Improper Platform Usage M2: Insecure
Data Storage M3: Insecure Communication M4: Insecure Authentication M5: Insufficient Cryptography M6: Insecure Authorization M7: Client Code Quality M8: Code Tampering M9: Reverse Engineering M10: Extraneous Functionality https://owasp.org/www-project-mobile-top-10/ -
OWASP Mobile Top 10 M1: Improper Platform Usage M2: Insecure
Data Storage M3: Insecure Communication M4: Insecure Authentication M5: Insufficient Cryptography M6: Insecure Authorization M7: Client Code Quality M8: Code Tampering M9: Reverse Engineering M10: Extraneous Functionality https://owasp.org/www-project-mobile-top-10/ -
2016 M1: Improper Platform Usage M2: Insecure Data Storage M3:
Insecure Communication M4: Insecure Authentication M5: Insufficient Cryptography M6: Insecure Authorization M7: Client Code Quality M8: Code Tampering M9: Reverse Engineering M10: Extraneous Functionality M1: Weak Server Side Controls M2: Insecure Data Storage M3: Insufficient Transport Layer Protection M4: Unintended Data Leakage M5: Poor Authorization and Authentication M6: Broken Cryptography M7: Client Side Injection M8: Security Decisions Via Untrusted Inputs M9: Improper Session Handling M10: Lack of Binary Protection 2014 OWASP Mobile Top 10 -
2016 M1: Improper Platform Usage M2: Insecure Data Storage M3:
Insecure Communication M4: Insecure Authentication M5: Insufficient Cryptography M6: Insecure Authorization M7: Client Code Quality M8: Code Tampering M9: Reverse Engineering M10: Extraneous Functionality M1: Weak Server Side Controls M2: Insecure Data Storage M3: Insufficient Transport Layer Protection M4: Unintended Data Leakage M5: Poor Authorization and Authentication M6: Broken Cryptography M7: Client Side Injection M8: Security Decisions Via Untrusted Inputs M9: Improper Session Handling M10: Lack of Binary Protection 2014 OWASP Mobile Top 10 -
Improper Platform Usage Permissions TouchID / FaceID Keychain Secure Enclave
URL Schemas WebView Autocorrection -
Improper Platform Usage UserDefaults Not encrypted, accessible on a locked
device. If I want to store some dataโฆ -
Improper Platform Usage UserDefaults Not encrypted, accessible on a locked
device. Keychain Encrypted storage, becomes decrypted on unlock. If I want to store some dataโฆ -
Improper Platform Usage UserDefaults Not encrypted, accessible on a locked
device. Keychain Encrypted storage, becomes decrypted on unlock. Secure Enclave Stores keys that can be used to encrypt Keychain entries. If I want to store some dataโฆ -
Improper Platform Usage Not strict Keychain access policy == Attacker
can easily access Keychain data -
Improper Platform Usage kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly kSecAttrAccessibleWhenUnlockedThisDeviceOnly kSecAttrAccessibleWhenUnlocked kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly kSecAttrAccessibleAfterFirstUnlock Or encrypt
and decrypt on your own ๐ Secure Enclave ๐ CryptoKit ๐ Themis ๐ -
Improper Platform Usage kSecAttrAccessibleWhenPasscodeSetThisDeviceOnly kSecAttrAccessibleWhenUnlockedThisDeviceOnly kSecAttrAccessibleWhenUnlocked kSecAttrAccessibleAfterFirstUnlockThisDeviceOnly kSecAttrAccessibleAfterFirstUnlock Or encrypt
and decrypt on your own ๐ Secure Enclave ๐ CryptoKit ๐ Themis ๐ AND! -
Improper Platform Usage ๐ฅ ๐ฅ ๐ฅ ๐คฏ ๐ฅ Returns boolean
= easy to bypass -
Improper Platform Usage ๐ ๐ ๐ ๐ โบ Triggers biometry
check automatically Specific attributes -
Insecure Data Storage Data generated by the app: ๐น Logs
๐น Databases ๐น Caches ๐น Other saved files -
Insecure Data Storage Data generated by the app: ๐น Logs
๐น Databases ๐น Caches ๐น Other saved files Check if any sensitive data may appear there! -
Insecure Data Storage Data generated by the app: ๐น Logs
๐น Databases ๐น Caches ๐น Other saved files Check if any sensitive data may appear there! (check the code, not the files) -
Insecure Data Storage Data stored inside the .ipa: ๐น Configuration
files ๐น Executables -
Insecure Data Storage Data stored inside the .ipa: ๐น Configuration
files ๐น Executables Look for testing credentials and endpoints! -
Insecure Data Storage Data stored inside the .ipa: ๐น Configuration
files ๐น Executables Look for testing credentials and endpoints! (actually, any credentials and endpoints) -
Insecure Data Storage Data stored inside the .ipa: ๐น Configuration
files ๐น Executables Look for testing credentials and endpoints! (actually, any credentials and endpoints) (config comments may not be removed) -
Insecure Data Storage Data stored inside the .ipa: ๐น Configuration
files ๐น Executables [22:05:16] juliapotapenko:MyAwesomeAppl.app $ strings MyAwesomeApp | grep "https://" -
Insecure Communication App Transport Security Do not allow HTTP HTTP
allowed for all endpoints HTTP allowed for localhost -
Insecure Communication SERVER iOS APP ATTACKER TLS Pinning Prevent MiTM
TLS Cert MiTM Cert -
Insecure Communication SERVER iOS APP ATTACKER TLS Pinning Prevent MiTM
TLS Cert MiTM Cert โ Is trusted CA? โ Not expired? -
Insecure Communication SERVER iOS APP ATTACKER TLS Pinning Prevent MiTM
TLS Cert MiTM Cert โ Is trusted CA? โ Not expired? โ Is it our serverโs cert? -
Insecure Communication TLS Pinning Prevent MiTM It is just an
Info.plist entry. I can bypass pinning by removing or changing it. Correct. But the main goal is to protect against MiTM when the attacked doesnโt have access to a physical device. -
Insecure Communication TLS Pinning Prevent MiTM It is just an
Info.plist entry. I can bypass pinning by removing or changing it. Correct. But the main goal is to protect against MiTM when the attacked doesnโt have access to a physical device. -
Unintended Data Leakage Application Backgrounding What to protect? * *
* * * Think of accidental sharing Sensitive data -
Unintended Data Leakage Application Backgrounding What to protect? * *
* * * Think of accidental sharing Sensitive data How to protect? Screen overlay Remove entered data Return to previous screen -
Summary Weโve learned - where we can read about common
vulnerabilities - examples of top vulnerabilities - keychain - app generated content - allowing HTTP - biometrics - data stored in .ipa - TLS pinning - backgrounging - screen overlay