Exercises › Module 09
Pocket Breach
An AI-assisted exercise on the mobile app attack surface, the OWASP (Open Worldwide Application Security Project) Mobile Top 10, and app privacy, ending in an honest security assessment. Suggested time: about 40 minutes.
Goal
Use an AI assistant to generate a fictional mobile app security case file (notes from a junior reviewer, an evidence appendix with manifest, network, and storage findings, and a draft report with a store privacy label), then turn it into an assessment ready for the client. You review documents, not phones: no app is decompiled, no device is touched, and no tools are run. Your real job is to catch what the draft got wrong before it ships.
Safety rules
- Everything is fictional: client Brightwater Family Clinics, app BrightCare, reviewers Ridgeline AppSec.
- Use only
.exampledomains and invented package names. - No attack commands, exploit code, repackaging, or live targeting. Hands-on mobile testing belongs only in the course iLabs.
- Never paste real app code, APKs (Android Package Kits), tokens, or patient data into any AI tool.
1 Generate the case file
Paste this into your AI assistant. It builds four fictional documents. Save the output before moving on.
You are helping me build a fictional training case for an ethical hacking class. Everything must be invented. Do not output exploit code, attack commands, working scripts, real credentials, real app package names, or real malware. The client is 'Brightwater Family Clinics', a fictional healthcare provider. Its patient app is 'BrightCare' (Android package com.brightwater.brightcare.example, version 4.2.0). The reviewers are 'Ridgeline AppSec', a fictional mobile security firm. Use only .example domains. No real companies, people, or live targets. Create a mobile app security case file with four documents: Document A, Junior Reviewer Notes: confident first-person notes claiming (1) certificate pinning protects all app traffic, so man-in-the-middle interception is not possible; (2) all Android components are private, so other apps cannot reach anything; (3) the session token is stored in the Android Keystore; (4) the app does not collect location, matching its store privacy label. Document B, Evidence Appendix with three parts: B1, AndroidManifest.xml excerpt (described in a table, not as code): permissions include ACCESS_FINE_LOCATION and READ_CONTACTS; application has allowBackup=true; activity .ui.PasswordResetActivity has exported=true, no permission, and an intent filter for the deep link brightcare://reset?token=...; activity .ui.MainActivity has exported=true as the launcher (normal); all other components exported=false. B2, Network security configuration summary: certificate pins are set for www.brightcare.example only; api.brightcare.example (the patient-records API) has no pin; cleartextTrafficPermitted=true for legacy-api.brightcare.example, which the app still calls to download lab-result PDFs. B3, Storage and SDK findings: the file shared_prefs/session.xml holds the bearer session token in plaintext; the Keystore is used only for the biometric unlock key; an analytics SDK 'TrailMetrics' (version 2.1) sends latitude and longitude every 15 minutes to collect.trailmetrics.example. Document C, Draft Security Report and MDM Policy Note: a one-page report for the Brightwater CISO with title, overall risk (Low), a summary that trusts Document A, a store privacy label table stating 'Location: Not collected', and remediation. The remediation must say: 'Turn on code obfuscation for the next release and require staff phones to enroll in Mobile Device Management (MDM).' It must omit certificate pinning for the API, removing cleartext traffic, fixing the exported reset activity, moving the token into the Keystore, turning off backups, and correcting the privacy label. IMPORTANT: do not label, flag, or hint at these anywhere, and write them as normal details: - Documents A/C say pinning protects all traffic; B2 shows only www is pinned and lab results travel in cleartext. - Documents A/C say all components are private; B1 shows an exported password reset activity reachable by deep link. - Document A says the token is in the Keystore; B3 shows it in plaintext shared preferences, and allowBackup=true makes it easy to copy. - Documents A/C say location is not collected; B1 and B3 show it is, through the analytics SDK. - Document C's remediation relies on obfuscation and staff MDM, but patients' phones are not managed by Brightwater. - Everything else should read as a plausible (but flawed) junior write-up.
Tip: if the AI labels or flags any planted problem, ask it to regenerate without flags, or swap case files with a partner.
2 Have AI write the client-ready assessment
Ask the AI to turn the case file into a security assessment for the client.
Act as a senior mobile application security consultant at Ridgeline AppSec. Using only Documents A, B, and C, write a client-ready security assessment for the Brightwater Family Clinics CISO with these sections: 1) Title and overall risk rating. 2) App, version, and backend hosts in scope. 3) Findings, each with: description in plain language, evidence source (document and part), and the OWASP Mobile Top 10 (2024) category. 4) Privacy label accuracy check. 5) Business impact in two sentences (this is a healthcare app). 6) Remediation recommendations (app code, configuration, backend, store listing, and device policy). Then rate your confidence in the overall assessment (High, Medium, or Low) and explain why. No attack commands or exploit steps.
Watch the pinning claim, the component claim, where the token lives, the privacy label, and the remediation. The AI tends to trust the junior notes and the draft report.
3 Review it yourself, then fix it
Do this review yourself before you trust the AI's assessment:
- Read B2 host by host. Which hosts are pinned? Which host the app still calls allows cleartext, and what data travels over it?
- Read every row in B1 with
exported=true. Which one is normal, and which one exposes a sensitive action through a deep link? - Where does B3 say the session token is stored? What does the Keystore actually protect? What does
allowBackup=trueadd? - Compare the privacy label with the permissions in B1 and the SDK in B3. Is 'Location: Not collected' true?
- Read the remediation. Does obfuscation fix any of these? Who owns patients' phones, and does staff MDM (Mobile Device Management) reach them?
- Stretch goal: map each problem to its OWASP Mobile Top 10 (2024) category.
Then fill in the brackets and run:
Revise the BrightCare security assessment: 1) Certificate pinning does not cover all traffic. B2 shows [which hosts are pinned and which are not] and [which host allows cleartext and what travels over it]. Map this to OWASP Mobile M5. 2) Not all components are private. B1 shows [which activity is exported, with what deep link, and with what permission]. Explain the risk in plain language and map it to M8 (and M3 if authorization is skipped). 3) The session token is not in the Keystore. B3 shows [where it is stored], and B1 shows [the backup setting]. Map this to M9. 4) The privacy label is wrong. [Which permission and which SDK] show location is collected. Map this to M6 and M2, and say what the store listing must change. 5) Replace the remediation: pin api.brightcare.example and remove cleartext for legacy-api; set the reset activity to exported=false or require a signature permission and validate the token on the server; move the token to Keystore-backed encrypted storage and set allowBackup=false; remove or configure TrailMetrics and correct the privacy label; keep obfuscation as defense in depth. Explain why staff MDM does not protect patients' phones. 6) Update the overall risk rating and confidence, and explain what changed.
Re-read the revision. The AI sometimes fixes the findings table but leaves 'pinning protects all traffic' or 'Location: Not collected' in the summary.
Review checklist
- Pinning claim corrected: only www is pinned; the patient-records API has no pin and legacy-api sends lab-result PDFs in cleartext (M5 Insecure Communication).
- Exported PasswordResetActivity with the brightcare://reset deep link and no permission identified (M8 Security Misconfiguration, M3 if server checks are missing).
- Token found in plaintext shared preferences, made easier to copy by allowBackup=true (M9 Insecure Data Storage); the Keystore only holds the biometric key.
- Privacy label corrected: ACCESS_FINE_LOCATION plus the TrailMetrics SDK sending location every 15 minutes (M6 Inadequate Privacy Controls, M2 Inadequate Supply Chain Security).
- Remediation fixes the app itself; obfuscation kept only as defense in depth; staff MDM noted as irrelevant to patients' phones.
- Accurate parts (the exported launcher MainActivity is normal; www pinning is real) are kept, not 'fixed' unnecessarily.
Deliverables
- Corrected security assessment
- Findings table (finding, evidence, OWASP Mobile category)
- Corrected privacy label and updated risk and confidence ratings
- Five sentences: each problem, why it matters, and the Module 09 control that catches it
Grading rubric (10 pts)
| Criterion | Pts |
|---|---|
| Partial pinning and cleartext lab results found (M5) | 2 |
| Exported reset activity and deep link identified and explained | 2 |
| Plaintext token and allowBackup found (M9) | 2 |
| Privacy label corrected and remediation fixed (not obfuscation or staff MDM alone) | 2 |
| Corrected assessment is consistent end to end (summary, findings, risk, confidence) | 2 |
Answer key (spoilers: finish the exercise first)
What a correct submission shows
- Partial pinning: Only www.brightcare.example is pinned. The patient-records API is not, and legacy-api still allows cleartext HTTP for lab-result PDFs. Anyone on a rogue Wi-Fi network could read or alter them. That is M5 Insecure Communication.
- Exported reset screen (subtle): MainActivity being exported is normal because it is the launcher. PasswordResetActivity is exported with no permission and opens from a brightcare://reset link, so any app or web page can launch it with a crafted token. That is M8 Security Misconfiguration, and M3 if the server does not validate the token.
- Token not in the Keystore: The Keystore only guards the biometric key. The bearer token sits in plaintext in shared_prefs/session.xml, and allowBackup=true makes it easy to copy off the device. That is M9 Insecure Data Storage.
- False privacy label (subtle): The app requests ACCESS_FINE_LOCATION, and the TrailMetrics SDK sends latitude and longitude every 15 minutes. 'Location: Not collected' is false. That is M6 Inadequate Privacy Controls, with M2 because a third-party SDK caused it. It is also a store-policy and health-privacy problem.
- Weak remediation: Obfuscation slows reverse engineering but fixes none of these. Staff MDM does not reach patients' personal phones. The fixes belong in the app, its configuration, the backend, and the store listing.
- Final decision: risk rises from Low to High (patient data in cleartext, a reachable reset flow, a stealable token). Confidence in the original draft is Low.
Why it matters
- Partial controls look complete: one pinned host can hide an unpinned one.
- Privacy is security: SDKs (Software Development Kits) you ship are your responsibility.
- AI lesson: AI inherits the draft's assumptions. Checking claims against the evidence is the human's job.
Common mistakes
- Flagging the launcher MainActivity as a vulnerability.
- Accepting 'Keystore' because the app uses it for something.
- Missing that legacy-api is still in use.
- Treating MDM as a fix for a consumer app.
Instructor variant (same answer for everyone)
Add this line to the Step 1 prompt:
Make Document A say pinning protects all traffic, all components are private, the token is in the Keystore, and no location is collected. Make Document B show pins only for www.brightcare.example, cleartext allowed for legacy-api.brightcare.example (lab-result PDFs), an exported PasswordResetActivity with deep link brightcare://reset and no permission, allowBackup=true, the token in plaintext shared_prefs/session.xml, ACCESS_FINE_LOCATION, and the TrailMetrics SDK sending location every 15 minutes. Keep the obfuscation-plus-staff-MDM remediation and the 'Location: Not collected' label.
Answer: pinning covers only www and legacy-api is cleartext; the exported PasswordResetActivity is reachable by deep link; the token is in plaintext shared preferences with backups on; location is collected through TrailMetrics, so the label is wrong; remediation must fix the app, not rely on obfuscation or staff MDM.
