iOS App Security/Sample report

Sample iOS app security report

This is a complete review, exactly as a client receives it, of DVIA-v2, an open-source iPhone app built to be insecure for security training. No real company or user data is involved. Secrets in the findings are masked, as in every client report.

Result

F 0/100

24 confirmed issues; 1 automated match reviewed and dismissed. A failing grade is expected: the app exists to be vulnerable.

0

Critical

8

High

11

Medium

4

Low

1

Info

DVIA-v2 is a deliberately vulnerable training app, so a failing grade is expected. Its worst issues are the ones we see most often in real apps: credentials kept in plaintext on the device (plist, UserDefaults, Core Data, Realm, Couchbase, YapDatabase), a hard-coded encryption password, a login checked against a password compiled into the app, and App Transport Security switched off. Interactive security controls (jailbreak detection, anti-debugging, runtime manipulation) were not assessed; they need testing on a device.

Repository github.com/prateek147/DVIA-v2 at commit 96466ab 2024-03-29. Reviewed 2026-11-26 against OWASP MASVS v2 and the OWASP Mobile Top 10 (2024).

Scope

The app's source code, settings, git history, libraries and the backend configuration it ships with. Not covered: attacking the running app on a device (jailbreak, tampering, runtime manipulation) or testing live servers. The table shows how each OWASP MASVS control was covered.

ControlCoverageFindings
MASVS-STORAGE-1The app securely stores sensitive dataAutomated + analyst4
MASVS-STORAGE-2The app prevents leakage of sensitive dataPartly (rest needs a device)2
MASVS-CRYPTO-1The app employs current strong cryptography and uses it according to best practicesAutomated + analyst2
MASVS-CRYPTO-2The app performs key management according to industry best practicesAutomated + analyst2
MASVS-AUTH-1The app uses secure authentication and authorization protocolsPartly (rest needs a device)2
MASVS-AUTH-2The app performs local authentication securely according to the platform best practicesAutomated + analyst1
MASVS-AUTH-3The app secures sensitive operations with additional authenticationAnalyst review
MASVS-NETWORK-1The app secures all network traffic according to the current best practicesAutomated + analyst2
MASVS-NETWORK-2The app performs identity pinning for all remote endpoints under the developer's controlPartly (rest needs a device)
MASVS-PLATFORM-1The app uses IPC mechanisms securelyAutomated + analyst2
MASVS-PLATFORM-2The app uses WebViews securelyAutomated + analyst2
MASVS-PLATFORM-3The app uses the user interface securelyAnalyst review
MASVS-CODE-1The app requires an up-to-date platform versionAutomated + analyst1
MASVS-CODE-2The app has a mechanism for enforcing app updatesAnalyst review
MASVS-CODE-3The app only uses software components without known vulnerabilitiesAutomated + analyst2
MASVS-CODE-4The app validates and sanitizes all untrusted inputsPartly (rest needs a device)
MASVS-RESILIENCE-1The app validates the integrity of the platformNot covered (needs a device)
MASVS-RESILIENCE-2The app implements anti-tampering mechanismsNot covered (needs a device)
MASVS-RESILIENCE-3The app implements anti-static analysis mechanismsNot covered (needs a device)
MASVS-RESILIENCE-4The app implements anti-dynamic analysis techniquesPartly (rest needs a device)
MASVS-PRIVACY-1The app minimizes access to sensitive data and resourcesAutomated + analyst2
MASVS-PRIVACY-2The app prevents identification of the userAnalyst review
MASVS-PRIVACY-3The app is transparent about data collection and usageAnalyst review
MASVS-PRIVACY-4The app offers user control over their dataAnalyst review

Findings

Ranked by severity. Each one names the file and line, explains the risk and gives the fix.

High1. Hard-coded password or API credentialMASVS-AUTH-1 · M1:2024 Improper Credential Usage · CWE-798 · 5 locationsShow

A password or API credential appears to be hard-coded in the source.

Analyst note: Literal passwords in source (memory and cookie demos). They are readable from the shipped binary with the strings tool.

Vulnerabilities/Sensitive Information in Memory/Controller/SensitiveInformationInMemoryDetailsViewController.swift:19

let password = "ev••••••"

Vulnerabilities/Sensitive Information in Memory/Controller/SensitiveInformationInMemoryDetailsViewController.swift:32

let passwd = "te••••••"

Also at: Vulnerabilities/Side Channel Data Leakage/Controller/CookiesViewController.swift:19, Vulnerabilities/Side Channel Data Leakage/Controller/Objective-C Methods/SetSharedCookies.m:21

Fix: Remove the credential, rotate it, and fetch per-user tokens from your backend after sign-in.

High2. Sensitive data in log outputMASVS-STORAGE-2 · M9:2024 Insecure Data Storage · CWE-532 · 3 locationsShow

A log statement appears to include a credential or token. Device logs are readable by anyone with physical or MDM access.

Analyst note: DeviceLogsViewController logs the whole sign-up object, which contains the user's password, phone and email in plaintext, so it lands in the device log. The PIN screen also logs the derived key, which together with the 500-round SHA-1 derivation makes the 4-digit PIN recoverable.

Vulnerabilities/Broken Cryptography/Controller/BrokenCryptographyPinDetailsViewController.swift:97

print("encryptedData (SHA1): \(encryptedData! as NSData)")

Vulnerabilities/Side Channel Data Leakage/Controller/DeviceLogsViewController.swift:49

print("user saved: \(user.description)")

Fix: Remove the log line or redact the value. Use os_log with %{private} for anything user-specific.

High3. Hard-coded key or password passed to encryptionMASVS-CRYPTO-2 · M10:2024 Insufficient Cryptography · CWE-321 · 2 locationsShow

A literal password, key, IV or salt is passed straight into a crypto call. Anyone with the binary can read it and decrypt the data.

Vulnerabilities/Broken Cryptography/Controller/BrokenCryptographyDetailsViewController.swift:43

let encryptedData = try? RNEncryptor.encryptData(data, with: kRNCryptorAES256Settings, password: "@d••••••")

Vulnerabilities/Broken Cryptography/Controller/BrokenCryptographyDetailsViewController.swift:52

let decryptedData = try? RNDecryptor.decryptData(encryptedData, withPassword: "@d••••••")

Fix: Derive or generate the key at runtime and keep it in the Keychain or Secure Enclave; never ship it in code.

High4. App Transport Security is disabled for all connectionsMASVS-NETWORK-1 · M5:2024 Insecure Communication · CWE-319Show

NSAllowsArbitraryLoads is true, so the app may connect to any server over plain HTTP or with weak TLS, and iOS will not stop it.

Info.plist

NSAllowsArbitraryLoads = true

Fix: Remove NSAllowsArbitraryLoads. If one legacy host needs HTTP, add a narrowly scoped NSExceptionDomains entry for that host only and plan to retire it.

High5. Login checked against a hard-coded passwordMASVS-AUTH-1 · M1:2024 Improper Credential Usage · CWE-798Show

A password or secret is compared against a hard-coded value inside the app, so the "secret" can be read from the binary and the check patched out.

Vulnerabilities/Application Patching/Controller/ApplicationPatchingDetailsViewController.swift:38

if username == "Ad••••••" && password == "Th••••••" {

Fix: Authenticate on the server. The app should send the credential over TLS and receive a token, never compare it locally.

High6. Credential written to an unencrypted plist fileMASVS-STORAGE-1 · M9:2024 Insecure Data Storage · CWE-312Show

A sensitive value is put into a dictionary that is then written to a plist file in the app container, unencrypted.

Vulnerabilities/Insecure Data Storage/Controller/PListViewController.swift:49

data.setValue(username, forKey: "username")

Fix: Keep credentials in the Keychain. If a file is unavoidable, encrypt it with a Keychain-held key and write it with .completeFileProtection.

High7. Weak password-based key derivation (low iteration count)MASVS-CRYPTO-1 · M10:2024 Insufficient Cryptography · CWE-916Show

Password-based key derivation with a low iteration count makes offline brute force cheap, especially for short PINs.

Analyst note: 500 iterations of PBKDF2-HMAC-SHA1 over a 4-digit PIN: all 10,000 PINs can be tried in well under a second.

Vulnerabilities/Broken Cryptography/Controller/BrokenCryptographyPinDetailsViewController.swift:88

let rounds = 500

Fix: Use PBKDF2-HMAC-SHA256 with at least 600,000 iterations (OWASP 2023), or keep the secret in the Keychain behind device passcode or biometrics instead of deriving it from a PIN.

High8. WebView content built from unescaped inputMASVS-PLATFORM-2 · M4:2024 Insufficient Input/Output Validation · CWE-79Show

JavaScript or HTML is built from a variable and run in a WebView. If the value is user- or network-controlled this is script injection.

Analyst note: The name typed by the user is interpolated into HTML loaded in a UIWebView, which executes script. Entering <script>…</script> runs it in the app.

Vulnerabilities/Client Side Injection/Controller/ClientSideInjectionDetailViewController.swift:40

webView.loadHTMLString("Hello \(name), I am inside a WebView!", baseURL: nil)

Fix: Pass data to the page with WKScriptMessageHandler or JSON-encode it; never interpolate raw strings into JavaScript.

Medium9. Hard-coded http:// URLMASVS-NETWORK-1 · M5:2024 Insecure Communication · CWE-319 · 21 locationsShow

Hard-coded http:// URL. Traffic to it is readable and modifiable on the network.

Constants.swift:40

return "http://highaltitudehacks.com/2013/10/26/ios-application-security-part-20-local-data-storage-nsuserdefaults"

Constants.swift:42

return "http://damnvulnerableiosapp.com"

Also at: Constants.swift:46, Constants.swift:48, Constants.swift:50, Constants.swift:52, Constants.swift:54, Constants.swift:56 and 12 more

Fix: Use https:// and remove any App Transport Security exception that allowed it.

Medium10. Password field shows what is typedMASVS-STORAGE-2 · M9:2024 Insecure Data Storage · CWE-549 · 11 locationsShow

A password or PIN field does not use secure text entry, so the value is visible on screen, appears in screen recordings, and can be learned by the keyboard's autocorrect.

Vulnerabilities/Side Channel Data Leakage/SideChannelDataLeakage.storyboard:236

passwordTextField placeholder="Enter dummy password here"

Vulnerabilities/Side Channel Data Leakage/SideChannelDataLeakage.storyboard:587

cookiesPasswordTextField placeholder="Enter password from the cookies"

Also at: Vulnerabilities/Insecure Data Storage/InsecureDataStorage.storyboard:279, Vulnerabilities/Insecure Data Storage/InsecureDataStorage.storyboard:560, Vulnerabilities/Insecure Data Storage/InsecureDataStorage.storyboard:651, Vulnerabilities/Broken Cryptography/BrokenCryptography.storyboard:123, Vulnerabilities/Broken Cryptography/BrokenCryptography.storyboard:168, Vulnerabilities/Broken Cryptography/BrokenCryptography.storyboard:238 and 2 more

Fix: Turn on Secure Text Entry for the field (isSecureTextEntry = true), which also disables autocorrect and keyboard caching.

Medium11. Outdated or unmaintained CocoaPods dependenciesMASVS-CODE-3 · M2:2024 Inadequate Supply Chain Security · CWE-1104 · 7 locationsShow

CocoaPods has no public vulnerability database, so pods are checked for age instead. Old or abandoned libraries often carry unpatched security bugs and may not build with current Xcode.

Analyst note: Realm/RealmSwift are 16 major versions behind. Parse 1.19.4 targets the Parse hosted service that shut down in 2017. Couchbase Lite 1.x and Bolts have been unmaintained since 2018 and 2020. The Google Analytics iOS SDK v3 is deprecated.

  • Bolts 1.9.1: no release in 7 years (last 2020-04)
  • couchbase-lite-ios 1.4.4: no release in 8 years (last 2018-10)
  • Flurry-iOS-SDK 12.1.4: no release in 3 years (last 2023-08)
  • GoogleAnalytics 3.20.0: no release in 3 years (last 2024-03)
  • Parse 1.19.4: no release in 4 years (last 2022-10)
  • Realm 4.1.1: 16 major version(s) behind (installed 4.1.1, latest 20.0.6)
  • RealmSwift 4.1.1: 16 major version(s) behind (installed 4.1.1, latest 20.0.6)

Fix: Upgrade each pod to its current release, replace abandoned ones, and consider moving to Swift Package Manager, which is covered by GitHub security advisories.

Medium12. Local database in useMASVS-STORAGE-1 · M9:2024 Insecure Data Storage · CWE-312 · 7 locationsShow

Local database in use (SQLite, Core Data, Realm, Couchbase or YapDatabase). Confirm sensitive fields are not stored unencrypted.

Analyst note: All four local stores hold credentials unencrypted: Core Data and Realm (user.password), Couchbase Lite (a properties dictionary with username and password) and YapDatabase (setObject(password, forKey: "Password")).

Model/CoreDataClasses/CoreDataStack.swift:26

lazy var persistentContainer: NSPersistentContainer = {

Model/CoreDataClasses/CoreDataStack.swift:33

let container = NSPersistentContainer(name: "Model")

Also at: Model/CoreDataClasses/CoreDataStack.swift:69, Vulnerabilities/Insecure Data Storage/Controller/CouchbaseLiteViewController.swift:33, Vulnerabilities/Insecure Data Storage/Controller/RealmViewController.swift:36, Vulnerabilities/Insecure Data Storage/Controller/YapDatabaseViewController.swift:41

Fix: Keep secrets out of local databases, or encrypt them (SQLCipher, Realm encryptionKey held in the Keychain).

Medium13. Password or token saved in a local database modelMASVS-STORAGE-1 · M9:2024 Insecure Data Storage · CWE-312 · 3 locationsShow

A password, PIN or token is assigned to a model property. If that model is saved (Core Data, Realm, Couchbase, YapDatabase), the secret sits in a plaintext database file.

Analyst note: Core Data and Realm models store the password field in plaintext; no Realm encryptionKey is configured anywhere in the app.

Vulnerabilities/Insecure Data Storage/Controller/CoreDataViewController.swift:44

newUser?.password = passwordTextField.text

Vulnerabilities/Insecure Data Storage/Controller/CoreDataViewController.swift:62

newUser?.password = passwordTextField.text

Fix: Do not persist passwords at all; store a server-issued token in the Keychain instead. If a local secret is required, encrypt the store (SQLCipher, Realm encryptionKey) with a Keychain-held key.

Medium14. Face ID / Touch ID used as a simple yes/no checkMASVS-AUTH-2 · M3:2024 Insecure Authentication/Authorization · CWE-287 · 2 locationsShow

Face ID / Touch ID is checked with LAContext.evaluatePolicy. If the result is only a boolean, it can be bypassed at runtime on a jailbroken device.

Analyst note: Both the Swift and Objective-C Touch ID screens act on the success boolean alone, and SecAccessControlCreateWithFlags is used nowhere in the app, so nothing is released by the Secure Enclave. A hooking tool can return true and bypass it.

Vulnerabilities/TouchIDBypass/Controller/TouchIDAuthentication.m:44

[myContext evaluatePolicy:LAPolicyDeviceOwnerAuthenticationWithBiometrics

Vulnerabilities/TouchIDBypass/Controller/TouchIDDetailsViewController.swift:37

context.evaluatePolicy(.deviceOwnerAuthenticationWithBiometrics, localizedReason: reason) {

Fix: Bind biometric unlock to a Keychain item created with SecAccessControlCreateWithFlags(.biometryCurrentSet), so the secret is only released by the Secure Enclave.

Medium15. Secret committed to the repository (generic-api-key)MASVS-CRYPTO-2 · M1:2024 Improper Credential Usage · CWE-798Show

A credential matching the 'generic-api-key' rule is in the repository (commit 96466ab8). Anyone with the source, or with the shipped app if it is compiled in, can use it. Deleting the line does not help: it stays in git history.

Analyst note: A Flurry Analytics API key. Analytics keys identify the app rather than grant data access, so the impact is limited to polluting or impersonating the app's analytics; it is still committed in git history.

AppDelegate.swift:24

apiKey: "RE••••••"

Fix: Rotate the credential first, then remove it from the code and history, and load it from your backend at runtime instead.

Medium16. MD5 or SHA-1 in useMASVS-CRYPTO-1 · M10:2024 Insufficient Cryptography · CWE-328Show

MD5 or SHA-1 in use. Both are broken for integrity and must not be used for passwords or signatures.

Vulnerabilities/Broken Cryptography/Controller/BrokenCryptographyPinDetailsViewController.swift:63

CCPBKDFAlgorithm(kCCPRFHmacAlgSHA1),

Fix: Use SHA-256 or better (CryptoKit SHA256). For passwords use a slow KDF (PBKDF2 with 600k+ iterations, or Argon2).

Medium17. Deprecated UIWebView in useMASVS-PLATFORM-2 · M4:2024 Insufficient Input/Output Validation · CWE-749Show

UIWebView is deprecated, rejected by App Review, and cannot disable JavaScript or file access safely.

Vulnerabilities/Client Side Injection/Controller/ClientSideInjectionDetailViewController.swift:21

@IBOutlet var webView: UIWebView!

Fix: Migrate to WKWebView with JavaScript off unless required, and never allow file URL access to remote content.

Medium18. User input saved to UserDefaultsMASVS-STORAGE-1 · M9:2024 Insecure Data Storage · CWE-312Show

Text the user typed is saved straight into UserDefaults (an unencrypted plist). Confirm it is not a credential or personal data.

Analyst note: The typed value is persisted to the UserDefaults plist, readable from an unencrypted backup.

Vulnerabilities/Insecure Data Storage/Controller/UserDefaultsViewController.swift:35

defaults?.set(userDefaultsTextField.text, forKey: "DemoValue")

Fix: Keep anything sensitive in the Keychain; use UserDefaults only for non-sensitive preferences.

Medium19. Incoming URL handlerMASVS-PLATFORM-1 · M4:2024 Insufficient Input/Output Validation · CWE-939Show

The app handles incoming URLs (custom scheme or universal link). Every parameter it reads is untrusted input.

Analyst note: application(_:open:) reads splitUrl[1] without checking the array length, so any web page or app can crash DVIA with a link like dvia://x. Any link containing /phone/call_number/<digits> triggers the 'call' flow with no source check.

AppDelegate.swift:33

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

Fix: Validate the host, path and every parameter, and never perform a sensitive action from a link without user confirmation.

Low20. No privacy manifest (PrivacyInfo.xcprivacy)MASVS-PRIVACY-1 · M6:2024 Inadequate Privacy Controls · CWE-359Show

Apple requires a privacy manifest declaring collected data and use of 'required reason' APIs (UserDefaults, file timestamps, disk space, boot time). App Store Connect rejects uploads that use those APIs without one.

Fix: Add PrivacyInfo.xcprivacy to the app target, declaring data types collected and the reason codes for each required-reason API.

Low21. Supports iOS 12, which no longer gets security updatesMASVS-CODE-1 · M8:2024 Security Misconfiguration · CWE-1104Show

The lowest deployment target is iOS 12. Users on that version run an operating system with known, unpatched vulnerabilities, and newer protections (for example, stricter ATS and Keychain defaults) are unavailable.

DVIA-v2.xcodeproj/project.pbxproj

IPHONEOS_DEPLOYMENT_TARGET = 12

Fix: Raise the minimum to a supported iOS version (Apple patches roughly the last two majors).

Low22. Third-party code copied into the repositoryMASVS-CODE-3 · M2:2024 Inadequate Supply Chain Security · CWE-1104Show

4 libraries are copied into DVIA-v2/DVIA-v2/Vendor instead of being managed by a package manager. Their versions are not tracked, so security fixes upstream never reach the app and no scanner can match them against advisories.

Analyst note: RNCryptor, YapDatabase, CocoaLumberjack, PDKeychainBindings and Obfuscator.swift are copied in by hand; their versions are unknown, and RNCryptor's Objective-C implementation has been superseded by the Swift version.

  • CocoaLumberjack, PDKeychainBindings, RNCryptor, YapDatabase

Fix: Move each library to Swift Package Manager (or CocoaPods) pinned to a current release, or record the upstream version of each copy and check it on a schedule.

Low23. Custom URL schemes registeredMASVS-PLATFORM-1 · M4:2024 Insufficient Input/Output Validation · CWE-939Show

The app registers dvia, dviaswift. Any app or web page can open these and pass parameters, and another app can register the same scheme to intercept them.

Analyst note: dvia and dviaswift can be invoked or claimed by any app; see the handler crash above.

Info.plist

dvia, dviaswift

Fix: Validate every parameter in the URL handler, never pass secrets (such as OAuth codes) through a custom scheme, and prefer Universal Links, which are bound to your domain.

Info24. Requests 2 sensitive permission(s)MASVS-PRIVACY-1 · M6:2024 Inadequate Privacy Controls · CWE-250Show

Declared permissions: camera, Face ID. Each one must be needed by a feature and disclosed in the App Store privacy label and privacy policy.

Analyst note: Camera (excessive-permissions demo) and Face ID (Touch ID demo) are each used by a feature.

Info.plist

camera, Face ID

Fix: Remove any permission no feature uses; request the rest at the moment of use, not at launch.

Reviewed and dismissed

Automated matches our consultant checked and found not to be vulnerabilities. Shown so you can see what was examined; they do not affect the grade.

  • TLS challenge handler accepts the server's certificate directly. Both handlers compare the server certificate (or its public key hash) with a pinned copy and cancel the challenge on mismatch, so they fail closed. Worth noting separately: they use the long-deprecated NSURLConnection, and pin the leaf certificate, which breaks on every certificate renewal.

Want this for your app?

Tell us about your app in a free 20-minute call.

About the review