Mobile application security report
Sample report for a fictional Android app. Values are invented and secrets are masked. trueoffensive.com/sample-report
01Executive summary
SampleOne finding gives direct access to the payment API from outside the app, and one lets a single tapped link open a pre-filled transfer. Both can be fixed in this release.
Top 3 fixes
- Rotate the live API secret and remove it from the appTreat the key as already compromised. Move signing server-side. Closes TO-001.
- Stop exporting TransferActivitySet
exported="false"and require the PIN on the server for every transfer. Closes TO-002. - Remove the cleartext exception for the API domainHTTPS only, then pin the API certificate. Closes TO-003.
02Findings, ranked by exploitability
SampleRank reflects what an attacker needs to use the finding, not only its rule severity. A finding that needs nothing but the public APK ranks above one that needs a rooted phone.
| Rank | ID | Severity | Finding | What an attacker needs |
|---|---|---|---|---|
| 1 | TO-001 | Critical | Live API secret hardcoded in the APK | Only the APK from the store |
| 2 | TO-002 | High | Transfer screen opens from any link, skipping the PIN | A link the user taps |
| 3 | TO-003 | High | Cleartext traffic allowed to the API domain | The same Wi-Fi network |
| 4 | TO-004 | Medium | Access token written to Logcat | USB debugging, or an SDK that uploads logs |
| 5 | TO-005 | Medium | AES in ECB mode for local storage | A rooted device or a full backup |
| 6 | TO-006 | Low | App data included in device backups (allowBackup="true") | An unlocked phone and a cable |
Live API secret hardcoded in the APK
TO-001 · rank 1SampleLocation: smali/com/payapp/net/BuildConfig.smali, line 142
Why it is exploitable
The APK is public. Anyone can download it, run apktool and read this value in under a minute. ProGuard and R8 rename classes; they do not hide string constants. With the secret, an attacker signs requests to your payment API directly, outside the app, its rate limits and its device checks.
Evidence
.field public static final API_BASE:Ljava/lang/String; = "https://api.payapp.example/v2"
.field public static final API_SECRET:Ljava/lang/String; = "sk_live_7Hq2••••••••••••••"
.field public static final VERSION_NAME:Ljava/lang/String; = "4.2.0"Steps to reproduce
apktool d payments-app-4.2.apk -o outgrep -rn "sk_live_" out/smali- Use the value as the
X-Api-Secretheader against/v2/merchants/me: the API answers 200.
Fix
Remove the secret from the client. Sign requests on your backend, or issue short-lived tokens per session after login. Rotate the exposed key today and check API logs for calls that did not come from the app's user agent.
- MASVS CRYPTO-2
- CWE 798
- SAMA CSF 3.3.6 · 3.3.9
- NCA ECC 2-8-3 Cryptography
- PCI DSS 8.6.2
Transfer screen opens from any link, skipping the PIN
TO-002 · rank 2SampleLocation: AndroidManifest.xml (TransferActivity) and smali/com/payapp/ui/TransferActivity.smali, lines 61 to 88
Why it is exploitable
TransferActivity is exported and listens for payapp://transfer. On launch it reads to, amount and note from the link and fills in the form. The PIN prompt lives in ReviewActivity, the screen users normally pass through first. A link jumps straight over it, and the Confirm button posts to /v2/transfers with the stored session.
Evidence
<activity android:name=".ui.TransferActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="payapp" android:host="transfer"/>
</intent-filter>
</activity>
# TransferActivity.onCreate: link parameters go straight into the form
invoke-virtual {v1, v2}, Landroid/net/Uri;->getQueryParameter(Ljava/lang/String;)Ljava/lang/String;
invoke-virtual {p0, v3}, Lcom/payapp/ui/TransferActivity;->prefillBeneficiary(Ljava/lang/String;)VSteps to reproduce
- Log in to the app on a test device and leave it in the background.
adb shell am start -a android.intent.action.VIEW -d "payapp://transfer?to=SA4420000001234567891234&amount=4800¬e=refund"- The transfer screen opens with the sample IBAN and SAR 4,800 filled in. No PIN screen appears.
- Tap Confirm on a test account: the request to
/v2/transfersreturns 201.
Engagement note
The reply we usually get to this finding is: "the user has to be logged in, and they have to press Confirm." Both are true, and neither helps. Your users are always logged in; that is how a wallet app works. And the SMS has just told them to press the button. The PIN step the team relies on is real, it just sits on a screen this link never visits. We show it with the adb command above in the readout, and the conversation changes in about ten seconds.
Fix
Set android:exported="false" on TransferActivity. If marketing needs a link, route it to a screen that only opens the normal flow, and never pre-fill a beneficiary from outside input. Then move the PIN check to the server: /v2/transfers should reject any request without a fresh PIN or transaction-signing token, whatever screen sent it.
- MASVS PLATFORM-1 · CODE-4
- CWE 926
- SAMA CSF 3.3.6 · 3.3.13
- NCA ECC 1-6-3 Secure coding
- PCI DSS 6.2.4
Cleartext traffic allowed to the API domain
TO-003 · rank 3SampleLocation: res/xml/network_security_config.xml, line 4
Why it is exploitable
The config lets the app talk to the API without TLS. One older endpoint in LegacySync still builds an http:// URL. On shared Wi-Fi, an attacker on the same network reads and changes that traffic, including the session token in the header.
Evidence
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">api.payapp.example</domain>
</domain-config>Steps to reproduce
- Decompile and open
res/xml/network_security_config.xml. grep -rn "http://api.payapp" out/smalireturnsLegacySync.smali.- Route a test device through a proxy: the sync request appears in plain text with an
Authorizationheader.
Fix
Delete the cleartext exception, switch LegacySync to HTTPS, and add a pin set for api.payapp.example with a backup pin.
- MASVS NETWORK-1 · NETWORK-2
- CWE 319
- SAMA CSF 3.3.13
- NCA ECC 2-15-3 Secure protocols
- PCI DSS 4.2.1
Access token written to Logcat
TO-004 · rank 4SampleLocation: smali/com/payapp/auth/SessionManager.smali, line 211
Why it is exploitable
The release build logs the full access token at debug level. Anyone with USB debugging can read it with adb logcat, and crash or analytics SDKs that attach recent logs send it to a third party.
Evidence
const-string v1, "Session"
invoke-static {v1, v2}, Landroid/util/Log;->d(Ljava/lang/String;Ljava/lang/String;)I # v2 = "token=" + accessTokenSteps to reproduce
- Install the release build and log in.
adb logcat -s Sessionprintstoken=eyJhbGciOi…
Fix
Strip Log.d and Log.v from release builds with an R8 rule, and never log tokens or personal data at any level.
- MASVS STORAGE-2
- CWE 532
- SAMA CSF 3.3.6
- NCA ECC 2-7-2 Data protection
- PCI DSS 6.2.4
AES in ECB mode for local storage
TO-005 · rank 5SampleLocation: smali/com/payapp/storage/Vault.smali, line 58
Why it is exploitable
ECB encrypts identical blocks to identical output, so patterns in the stored card-on-file data stay visible, and blocks can be swapped without the key. It needs a rooted device or a backup first, which is why it ranks fifth.
Evidence
const-string v0, "AES/ECB/PKCS5Padding"
invoke-static {v0}, Ljavax/crypto/Cipher;->getInstance(Ljava/lang/String;)Ljavax/crypto/Cipher;Steps to reproduce
grep -rn "AES/ECB" out/smali- Confirm in
Vault.encrypt()that no IV is passed.
Fix
Use AES/GCM/NoPadding with a random 12-byte IV per record, and generate the key in the Android Keystore so it never leaves the device's secure hardware.
- MASVS CRYPTO-1
- CWE 327
- SAMA CSF 3.3.9
- NCA ECC 2-8-3 Cryptography
- PCI DSS 3.5.1 · 6.2.4
03Compliance summary
Sample| OWASP MASVS | Result | Findings | SAMA CSF | NCA ECC | PCI DSS v4.0 |
|---|---|---|---|---|---|
| CRYPTO-2 | Fail | TO-001 | 3.3.9 | 2-8-3 Cryptography | 8.6.2 |
| PLATFORM-1 | Fail | TO-002 | 3.3.6 | 1-6-3 Secure coding | 6.2.4 |
| CODE-4 | Fail | TO-002 | 3.3.6 | 1-6-3 Secure coding | 6.2.4 |
| NETWORK-1 | Fail | TO-003 | 3.3.13 | 2-15-3 Secure protocols | 4.2.1 |
| STORAGE-2 | Fail | TO-004, TO-006 | 3.3.6 | 2-7-2 Data protection | 6.2.4 |
| CRYPTO-1 | Fail | TO-005 | 3.3.9 | 2-8-3 Cryptography | 3.5.1 |
| STORAGE-1 | Pass | None | 3.3.6 | 2-7-2 Data protection | 3.5.1 |
| NETWORK-2 | Pass | Pinning present for auth. host | 3.3.13 | 2-15-3 Secure protocols | 4.2.1 |
| PLATFORM-2 | Pass | No WebView JavaScript bridges | 3.3.6 | 1-6-3 Secure coding | 6.2.4 |
| CODE-1 | Pass | minSdk 26, targetSdk 34 | 3.3.6 | 1-6-3 Secure coding | 6.3.3 |
| AUTH-1 | Dynamic test | Server-side session logic | 3.3.5 | 2-2 Identity and access management | 8.3.1 |
| RESILIENCE-1 | Dynamic test | Root and tamper detection at runtime | 3.3.6 | 1-6-3 Secure coding | 6.2.4 |
Sample data. The app, file paths, keys and IBAN are fictional and secrets are masked. NETWORK-2 passes for the auth. host only; TO-003 asks you to extend pinning to the API host. NCA ECC references use ECC-2:2024 control numbers. Control mappings are TrueOffensive's interpretation to support your evidence; check the current SAMA, NCA and PCI SSC documents for exact wording. A static scan does not replace a manual penetration test.