These are the notes for Cybersecurity Fundamentals (defensive), episode 70. Last episode protected laptops. This one protects the endpoint in everyone's pocket: the phone, where people keep their bank, chats, photos and payment apps. A phone runs dozens of apps written by strangers, so its security model is built on one idea: no app fully trusts another. We build mobile security step by step: keeping apps apart, letting the user decide what each app may touch, proving an app is genuine, the standard lists of where mobile apps go wrong, storing secrets, protecting traffic, handling links and web pages inside apps, and dealing with phones whose own walls have been removed. Every term is defined the first time it appears; the Glossary collects them.
Scope. Defensive and educational only. Every program is a small toy simulation on made-up data; nothing touches a real phone, app or server. Samples were run on 14 Nov 2026 in the SyntaxPilot compiler (Python 3).
Why phones are different
Real-life example: a hostel with forty strangers. Asha's phone holds her bank app, chats, photos and UPI app. Today she installs a free torch app written by someone she has never met. What stops that stranger from walking into the bank app's room?
- Security model: the set of rules the operating system enforces on every app that runs.
- App: a program installed on the phone. Each app is treated as a separate, partly trusted party.
- Token (session token): the secret an app sends to its server to prove "this user is logged in". Whoever holds it can act as the user, so it must be protected like a password.
Step 1: keeping apps apart (app sandboxing)
Demo 1: one phone, two apps
# Two apps on one phone. Can the free torch app read the bank app's files?
files = {"/data/bank/token.txt": "session=8f2c...e91", "/data/torch/settings.txt": "brightness=80"}
def read(app, path, sandbox):
owner = path.split("/")[2] # which app's folder is this?
if sandbox and owner != app:
raise PermissionError(f"{app} may not open {path}")
return files[path]
print("no sandbox:", read("torch", "/data/bank/token.txt", sandbox=False))
print("own file :", read("torch", "/data/torch/settings.txt", sandbox=True))
print("sandbox :", read("torch", "/data/bank/token.txt", sandbox=True))
Real output:
no sandbox: session=8f2c...e91
own file : brightness=80
Traceback (most recent call last):
File "main.py", line 12, in <module>
print("sandbox :", read("torch", "/data/bank/token.txt", sandbox=True))
~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "main.py", line 7, in read
raise PermissionError(f"{app} may not open {path}")
PermissionError: torch may not open /data/bank/token.txt
Without a sandbox, the torch app reads the bank's token at once. With the sandbox on, the same read raises PermissionError: the torch app may only open its own folder.
- App sandboxing: every app runs in its own isolated space with its own private storage, and cannot read or change another app's data. Apps that must share use official channels the operating system controls.
- iOS: Apple's platform security guide says all third-party apps are sandboxed; each app gets a unique home directory randomly assigned when the app is installed.
- Android: every app runs separately with its own private storage folder that other apps cannot open.
The two security models
| iOS | Android | |
|---|---|---|
| Where apps come from | mostly Apple's App Store | several app stores, plus sideloading |
| Isolation | every third-party app sandboxed | every app sandboxed |
| Extra powers | entitlements: signed key-value permissions that can't be changed after signing | permissions declared in the manifest, dangerous ones asked at runtime |
| Memory protection | ASLR and more | ASLR and more |
| Keys | Secure Enclave, Keychain | TEE / StrongBox, Android Keystore |
- Kernel (episode 9): the core of the operating system; it enforces the walls between apps.
- Root: the all-powerful administrator user on Unix-like systems. Normal apps never run as root.
- Entitlement (iOS): a digitally signed key-value pair that grants an app a specific privilege; because it is signed, it can't be changed.
- Sideloading: installing an app from outside an official store (for example an APK file from a link). It skips store checks and is the riskiest everyday habit on Android.
- ASLR (address space layout randomisation, episode 55): placing code and data at random memory addresses so memory-corruption bugs are harder to exploit.
Step 2: runtime permissions
Demo 2: asking at the moment of need
# Runtime permissions: the app asks at the moment it needs something, the user decides.
PROTECTION = {"INTERNET": "normal", "CAMERA": "dangerous", "READ_CONTACTS": "dangerous"}
user_says = {"CAMERA": "allow while in use", "READ_CONTACTS": "deny"}
def request(perm):
if PROTECTION[perm] == "normal":
return f"{perm:13} granted at install (normal)"
answer = user_says.get(perm, "deny")
return f"{perm:13} asked at runtime -> {answer}"
for p in ["INTERNET", "CAMERA", "READ_CONTACTS"]:
print(request(p))
contacts_ok = user_says["READ_CONTACTS"] != "deny"
print("share screen:", "pick from contacts" if contacts_ok else "type a number instead")
Real output:
INTERNET granted at install (normal)
CAMERA asked at runtime -> allow while in use
READ_CONTACTS asked at runtime -> deny
share screen: type a number instead
- Permission: an app's right to use something protected: the camera, contacts, location, the microphone.
- Normal permission: low risk (Android's example: setting the wallpaper; here: internet access). Granted at install without asking.
- Dangerous permission: reaches private data or controls the device in a way that can harm the user (for example reading the calendar or contacts). Android's documentation: Android 6.0 and higher requires dangerous permissions to use a runtime permissions model.
- Runtime permission: asked while the app is running, when the feature is used; the user can allow or deny. Since Android 10 the prompt can offer always allow, allow while in use or deny, and the user can change it later in Settings. iOS asks in the same way.
- Least privilege (episode 3) for apps: request the fewest permissions, at the moment you need them, explain why, and keep working when the user says no (the demo falls back to typing a number).
Step 3: trusting the app itself
Demo 3: who signed this update?
# App signing: the phone installs an update only if the SAME developer key signed it.
import hmac, hashlib
def sign(apk, key): return hmac.new(key, apk, hashlib.sha256).hexdigest()[:12]
DEV_KEY = b"ChaiPay developer key" # toy stand-in for a private signing key
THIEF_KEY = b"someone else's key"
def install_update(apk, signature): # the phone checks against the installed app
if signature == sign(apk, DEV_KEY):
return "installed"
return "REJECTED: not signed by the original developer"
v2 = b"ChaiPay v2"
print("genuine v2 :", install_update(v2, sign(v2, DEV_KEY)))
print("v2, bytes edited:", install_update(v2 + b" +spy", sign(v2, DEV_KEY)))
print("repackaged fake :", install_update(v2 + b" +spy", sign(v2 + b" +spy", THIEF_KEY)))
Real output:
genuine v2 : installed
v2, bytes edited: REJECTED: not signed by the original developer
repackaged fake : REJECTED: not signed by the original developer
- Digital signature (episode 16): a value made with a private key that anyone with the matching public key can check; it proves who signed and that nothing changed.
- App signing: every app package is signed with its developer's private key. The phone installs an update only if it is signed by the same key as the installed app, so an edited or repackaged copy is rejected. (In the toy, an HMAC stands in for a real public-key signature.)
- APK (Android Package): the file format of an Android app.
- Repackaging: unpacking a real app, adding malicious code, and re-signing it with a different key. Signing makes this impossible to pass off as an update.
- App store review: the store checks apps before publishing them, for known malware and policy problems. It reduces risk but isn't perfect, so apps still need the controls below.
Step 4: where mobile apps go wrong
OWASP Mobile Top 10 (2024 final release)
OWASP (Open Worldwide Application Security Project, episode 36) publishes the Mobile Top 10, an awareness list of the most common mobile app risks:
| # | Risk | In plain words |
|---|---|---|
| M1 | Improper Credential Usage | passwords or API keys hard-coded in the app or handled carelessly |
| M2 | Inadequate Supply Chain Security | risky third-party SDKs and libraries |
| M3 | Insecure Authentication/Authorization | weak login, missing permission checks on the server |
| M4 | Insufficient Input/Output Validation | trusting data from outside: links, files, other apps |
| M5 | Insecure Communication | traffic that can be read or changed in transit |
| M6 | Inadequate Privacy Controls | collecting or leaking more personal data than needed |
| M7 | Insufficient Binary Protections | an app that is easy to reverse engineer or patch |
| M8 | Security Misconfiguration | debug mode on, components exposed to other apps |
| M9 | Insecure Data Storage | secrets in plain files, logs or backups |
| M10 | Insufficient Cryptography | weak, outdated or home-made crypto |
- SDK (software development kit): a library a developer adds to the app, such as an analytics or ads kit. It runs with the app's permissions.
- Reverse engineering: taking an app apart to understand how it works; anyone can do this to an app on their own phone.
MASVS and MASTG
- MASVS (OWASP Mobile Application Security Verification Standard): the requirements a secure app must meet. Version 2 has 24 controls in 8 groups:
| Group | Covers |
|---|---|
| MASVS-STORAGE | storing sensitive data securely, preventing leaks |
| MASVS-CRYPTO | strong, current cryptography and sound key management |
| MASVS-AUTH | authentication and authorisation, local authentication |
| MASVS-NETWORK | securing all network traffic, pinning where the developer controls the server |
| MASVS-PLATFORM | safe use of IPC, WebViews and the user interface |
| MASVS-CODE | up-to-date platform, enforced updates, no known-vulnerable components, input validation |
| MASVS-RESILIENCE | platform integrity checks, anti-tampering, anti-static and anti-dynamic analysis |
| MASVS-PRIVACY | minimal data, no unnecessary identification, transparency, user control |
- MASTG (Mobile Application Security Testing Guide): explains how to test each MASVS requirement.
- In one line: Top 10 = awareness, MASVS = requirements, MASTG = tests.
- IPC (inter-process communication): official ways for apps to send data to each other (Android intents, iOS URL schemes and extensions).
Step 5: storing secrets on a phone
Demo 4: a token in a plain file vs a Keystore key
# Insecure data storage: where does the app keep the login token?
import json
token = "eyJhbGciOi...login-token-for-asha"
prefs = json.dumps({"user": "asha", "token": token}) # plain settings file
print("plain file :", prefs) # what a backup tool sees
class Keystore: # toy: the key lives inside secure hardware (XOR, NOT real crypto)
def __init__(self): self.__key = 0x5A
def encrypt(self, s): return bytes(ord(c) ^ self.__key for c in s).hex()[:24]
def export_key(self): raise PermissionError("key material is non-exportable")
ks = Keystore()
print("Keystore-encrypted:", ks.encrypt(token), "...")
print(ks.export_key())
Real output:
plain file : {"user": "asha", "token": "eyJhbGciOi...login-token-for-asha"}
Keystore-encrypted: 3f231032381d393315337474 ...
Traceback (most recent call last):
File "main.py", line 15, in <module>
print(ks.export_key())
~~~~~~~~~~~~~^^
File "main.py", line 11, in export_key
def export_key(self): raise PermissionError("key material is non-exportable")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: key material is non-exportable
- Insecure data storage (M9): keeping secrets where other tools can read them: plain settings files, logs, backups, the SD card.
- Android Keystore: Google's docs: it stores cryptographic keys to make them more difficult to extract from the device, with the key material non-exportable. Keys can be bound to secure hardware:
- TEE (Trusted Execution Environment): an isolated, protected area of the main processor.
- Secure Element / StrongBox: a separate tamper-resistant chip; StrongBox is available on Android 9 (API level 28) and later.
- Keys can require the user's lock-screen PIN, pattern, password or biometric before use.
- iOS Keychain: the system's encrypted store for small secrets such as passwords and tokens.
- The pattern: generate a key inside the Keystore, encrypt the token with it, store only the ciphertext. Store as little as possible. (The toy uses XOR only to show the idea; it is not real encryption.)
- Hard-coded secret (M1): an API key written into the app's code. The app runs on the attacker's own phone, so they can unpack it and read the key. Real secrets stay on the server.
Step 6: certificate pinning
Demo 5: a CA the phone trusts, but the app shouldn't
# Certificate pinning: trust only OUR server's public key, not any CA the phone trusts.
from hashlib import sha256
def pin(pubkey): return sha256(pubkey).hexdigest()[:12]
TRUSTED_CAS = {"Big Public CA", "Proxy CA (installed by user)"} # the phone's trust store
PINNED = {pin(b"ChaiPay server public key")}
def connect(cert, pinning):
if cert["issuer"] not in TRUSTED_CAS: return "blocked: unknown CA"
if pinning and pin(cert["pubkey"]) not in PINNED: return "blocked: key not pinned"
return "connected"
real = {"issuer": "Big Public CA", "pubkey": b"ChaiPay server public key"}
mitm = {"issuer": "Proxy CA (installed by user)", "pubkey": b"interceptor's key"}
for p in (False, True):
print(f"pinning={p!s:5} real: {connect(real, p):10} interceptor: {connect(mitm, p)}")
Real output:
pinning=False real: connected interceptor: connected
pinning=True real: connected interceptor: blocked: key not pinned
- TLS (episode 22): the encryption under HTTPS; the server proves its identity with a certificate.
- Certificate authority (CA) and trust store (episode 16): organisations that issue certificates, and the list of CAs a device trusts. A user, malware or a company proxy can add an extra CA.
- Interception (man-in-the-middle): a machine between app and server that decrypts and re-encrypts traffic using its own certificate.
- Certificate pinning: the app remembers its own server's public key (or a hash of it) and refuses any other key, even one a trusted CA vouches for. It addresses M5, insecure communication.
- Trade-offs: if the server key changes and the app isn't updated, users are locked out. Pin a backup key, plan rotation, and remember that pinning protects traffic, not a compromised phone.
Step 7: deep links and App Links
Demo 6: a link that pays
# Deep link: chaipay://pay?to=...&amount=... opens the payment screen directly.
from urllib.parse import urlparse, parse_qs
def handle_unsafe(link):
q = parse_qs(urlparse(link).query)
return f"PAID Rs {q['amount'][0]} to {q['to'][0]}" # trusts the link blindly
def handle_safe(link, contacts={"ravi-chai-stall"}):
q = parse_qs(urlparse(link).query)
to, amount = q.get("to", [""])[0], q.get("amount", ["0"])[0]
if not amount.isdigit() or int(amount) > 2000: return "rejected: bad amount"
note = "" if to in contacts else " (new payee: warn)"
return f"CONFIRM screen: pay Rs {amount} to {to}?{note}" # the user decides
evil = "chaipay://pay?to=scammer-99&amount=1999"
print("unsafe:", handle_unsafe(evil))
print("safe :", handle_safe(evil))
print("safe :", handle_safe("chaipay://pay?to=ravi-chai-stall&amount=-5"))
Real output:
unsafe: PAID Rs 1999 to scammer-99
safe : CONFIRM screen: pay Rs 1999 to scammer-99? (new payee: warn)
safe : rejected: bad amount
- Deep link: a link that opens a specific screen inside an app, such as
chaipay://pay?to=...&amount=.... Anyone can write one and send it, so it is untrusted input (M4). - Fix: validate every parameter, and never perform an important action (pay, delete, change settings) without the user confirming inside the app.
- Custom URL scheme: a made-up scheme like
chaipay://. Any app may register the same scheme, so another app could catch the link. - Android App Links: Google's docs: deep links that use the HTTP or HTTPS scheme and are verified by Android as associated with your website. You add
android:autoVerify="true"to the intent filter and publishassetlinks.jsonathttps://<your-host>/.well-known/assetlinks.json. Then other apps can't claim your web links. iOS's equivalent is universal links.
Step 8: WebView risks
Demo 7: an evil page calls the app's bridge
# A WebView shows web pages inside the app. The app adds a JavaScript "bridge" to native code.
def native_bridge(): # what page JavaScript can call, e.g. via addJavascriptInterface
return "token=eyJhbGciOi...asha"
ALLOWED = {"help.chaipay.example"}
def load(url, allowlist):
host = url.split("/")[2]
if allowlist and host not in ALLOWED:
return "opened in the browser, no bridge"
return "page calls bridge: " + native_bridge()
for allow in (False, True):
print("allowlist on:" if allow else "allowlist off:")
for u in ["https://help.chaipay.example/faq", "https://evil.example/win-prize"]:
print(f" {u.split('/')[2]:20} -> {load(u, allow)}")
Real output:
allowlist off:
help.chaipay.example -> page calls bridge: token=eyJhbGciOi...asha
evil.example -> page calls bridge: token=eyJhbGciOi...asha
allowlist on:
help.chaipay.example -> page calls bridge: token=eyJhbGciOi...asha
evil.example -> opened in the browser, no bridge
- WebView: a small browser window built into an app to show web pages.
- JavaScript bridge: a way for page JavaScript to call native app code (on Android,
addJavascriptInterface). Any page loaded in that WebView can call it. - WebView risks: a page from someone else runs with the app's powers: reading tokens, calling native functions, or showing a fake login inside a trusted app.
- Fixes: load only your own HTTPS pages (an allowlist of hosts); open everything else in the real browser; expose the smallest bridge, or none; keep JavaScript, file access and mixed content off unless needed.
Step 9: phones that aren't healthy
Demo 8: root and jailbreak signals
# Root / jailbreak detection: signals, not proof. Combine them, then limit the risk.
signals = {"su binary present": True, "app installed from unknown source": False,
"debugger attached": False, "OS integrity check failed": True}
for s, v in signals.items(): print(f" {s:34} {'yes' if v else 'no'}")
score = sum(signals.values())
action = "block payments, allow viewing" if score >= 2 else "normal"
print(f"risk signals: {score}/4 -> {action}")
Real output:
su binary present yes
app installed from unknown source no
debugger attached no
OS integrity check failed yes
risk signals: 2/4 -> block payments, allow viewing
- Rooting (Android) / jailbreaking (iOS): removing the operating system's restrictions to gain full administrator control. Malware on such a phone can break the sandbox walls.
- Root / jailbreak detection: checks an app runs for signs of a modified phone (a
sutool, failed OS integrity checks, debuggers). Detection is a signal, not proof: a determined attacker can hide it. Combine signals, check on the server too, and reduce what the app allows (view but not pay) rather than trusting the phone. - Mobile threat defence (MTD): an app or service on company phones that continuously detects risky apps, malicious networks, phishing links and compromised devices, and reports to MDM (episode 69), which can block company email on an unhealthy phone.
The whole chain
- A torch app reads the bank's token → app sandboxing.
- Accept-everything installs → runtime permissions.
- A fake update → app signing, app store review.
- Common app mistakes → OWASP Mobile Top 10, MASVS, MASTG.
- A token in a plain file → Android Keystore, iOS Keychain.
- An extra CA intercepts traffic → certificate pinning.
- A link pays a scammer → validate, confirm, App Links.
- An evil page calls the bridge → WebView allowlist, tiny bridge.
- A rooted phone → detection signals, mobile threat defence.
Common mistakes (and the fix)
| Mistake | What you see | Why | Fix |
|---|---|---|---|
| token in a plain prefs file | plain file : {"user": "asha", "token": ...} |
secret stored in clear text | Android Keystore / iOS Keychain |
| trying to copy a Keystore key out | PermissionError: key material is non-exportable |
that's the point: keys stay in hardware | use the key in place for encrypt/decrypt |
| deep link acts directly | unsafe: PAID Rs 1999 to scammer-99 |
the link is untrusted input | validate + confirm in the app |
| WebView loads any URL with a bridge | evil.example -> page calls bridge: token=... |
page JavaScript gets app powers | allowlist own pages, minimal bridge |
| API key hard-coded in the app | key visible after unpacking the APK | the app is on the attacker's phone | keep secrets on the server |
| asking for every permission at install | users deny or uninstall | not least privilege | ask late, ask little, degrade gracefully |
| pinning one key only | app breaks after server key rotation | no backup pin | pin a backup key, plan rotation |
| trusting a "not rooted" check | detection bypassed | detection is only a signal | server-side checks, limit risky actions |
Mini project: a mobile app security checklist runner
Combine the toys into one program that takes a dictionary describing an app (stores_token_in, permissions_requested, pins, deep_link_handlers, webview_hosts, hardcoded_keys, min_os_version) and prints, for each MASVS group, PASS or FIX with a one-line reason. Then score the app out of 8 and list its top three fixes.
Practice
1. Add a "max 3 payments a day" rule to the safe deep-link handler.
Solution
paid_today = 0
def handle_safe(link, contacts={"ravi-chai-stall"}):
global paid_today
q = parse_qs(urlparse(link).query)
to, amount = q.get("to", [""])[0], q.get("amount", ["0"])[0]
if not amount.isdigit() or int(amount) > 2000: return "rejected: bad amount"
if paid_today >= 3: return "rejected: daily link-payment limit reached"
paid_today += 1
note = "" if to in contacts else " (new payee: warn)"
return f"CONFIRM screen: pay Rs {amount} to {to}?{note}"
(A real app would count confirmed payments on the server, not in the app.)
2. Make the WebView toy refuse plain http:// pages even on the allowed host.
Solution
def load(url, allowlist):
host = url.split("/")[2]
if allowlist and (not url.startswith("https://") or host not in ALLOWED):
return "opened in the browser, no bridge"
return "page calls bridge: " + native_bridge()
3. Why does the "v2, bytes edited" case fail even though it carries the developer's real signature?
Solution
The signature was computed over the original bytes. The phone recomputes it over the bytes it received; any change gives a different value, so the check fails. A signature binds the signer and the exact content.
4. A user has installed a company proxy CA. Without pinning, can the proxy read the app's HTTPS traffic? With pinning?
Solution
Without pinning: yes, because the proxy's certificate chains to a CA in the phone's trust store. With pinning: no, because the proxy's public key doesn't match the pinned key, so the app refuses the connection.
5. Which permission level is "read contacts", and what should the app do if the user denies it?
Solution
Dangerous (it reaches private data), so it is asked at runtime. If denied, the app must keep working with a fallback, such as letting the user type a number.
Quick quiz
A: certificate pinning
B: the app sandbox
C: a deep link
D: the WebView
A free torch app tries to open the bank app's files on the same phone. What stops it?
Answer
B. The sandbox gives every app its own private storage that other apps cannot open. Pinning protects network traffic; deep links and WebViews are features that need their own care.
Interview questions
- What is app sandboxing? Each app runs isolated with private storage; it can't read or modify other apps' data, and shares only through OS-controlled channels.
- Normal vs dangerous permissions on Android? Normal ones are low risk and granted at install; dangerous ones reach private data or device control and are requested at runtime (Android 6.0+), revocable by the user.
- Why does app signing matter for updates? The OS installs an update only if it is signed by the same key as the installed app, which blocks tampered and repackaged versions.
- Name three OWASP Mobile Top 10 2024 risks. M1 Improper Credential Usage, M5 Insecure Communication, M9 Insecure Data Storage (also M2 supply chain, M4 input/output validation...).
- MASVS vs MASTG? MASVS states the security requirements; MASTG explains how to test them.
- Where should a mobile app store a refresh token? Encrypted with a key held in the Android Keystore / iOS Keychain, never in plain preferences or logs.
- What does certificate pinning protect against, and what is its risk? Interception through an extra or rogue CA; the risk is lockout when keys rotate without a backup pin.
- Why are deep links dangerous? Anyone can craft them; parameters are untrusted input, and custom schemes can be claimed by other apps. Use validation, confirmation and verified App Links / universal links.
- What is the risk of
addJavascriptInterface? Any page loaded in that WebView can call the exposed native methods. - Can root detection be trusted? No, it is a bypassable signal; combine signals, verify on the server, and limit sensitive actions.
- What is mobile threat defence? Continuous on-device detection of risky apps, networks, phishing and compromised devices, feeding MDM compliance decisions.
Glossary
| Term | Meaning |
|---|---|
| security model | the rules the operating system enforces on every app |
| app sandboxing | each app isolated with private storage, unable to touch other apps' data |
| token (session token) | a secret proving a user is logged in; whoever has it can act as the user |
| kernel | the core of the operating system that enforces isolation |
| root | the all-powerful administrator user |
| entitlement | a signed iOS key-value pair granting an app a specific privilege |
| sideloading | installing an app from outside an official store |
| ASLR | random memory placement that makes memory-corruption exploits harder |
| permission | an app's right to use a protected resource (camera, contacts...) |
| normal permission | a low-risk permission granted at install |
| dangerous permission | a permission reaching private data or device control; asked at runtime |
| runtime permission | a permission requested while the app runs, when the feature is used |
| least privilege | asking for only what is needed, only when needed |
| digital signature | a private-key value proving who signed and that nothing changed |
| app signing | signing every app package; updates must use the same key |
| APK | Android Package, the Android app file format |
| repackaging | unpacking an app, adding code and re-signing it with another key |
| app store review | the store's checks before an app is published |
| OWASP | Open Worldwide Application Security Project |
| OWASP Mobile Top 10 | an awareness list of the ten most common mobile app risks (2024 edition) |
| SDK | a third-party library added to an app |
| reverse engineering | taking an app apart to learn how it works |
| MASVS | OWASP Mobile Application Security Verification Standard: the requirements |
| MASTG | OWASP Mobile Application Security Testing Guide: how to test them |
| IPC | inter-process communication: official ways apps exchange data |
| insecure data storage | secrets kept where other tools can read them |
| Android Keystore | Android's protected store for keys; key material non-exportable |
| TEE | Trusted Execution Environment: an isolated area of the processor |
| Secure Element / StrongBox | a separate tamper-resistant chip for keys (StrongBox on Android 9+) |
| iOS Keychain | iOS's encrypted store for small secrets |
| hard-coded secret | a key or password written into the app's code |
| TLS | the encryption protocol under HTTPS |
| certificate authority (CA) | an organisation that issues certificates |
| trust store | the list of CAs a device trusts |
| interception (MITM) | a machine in the middle reading and changing traffic |
| certificate pinning | accepting only a known server public key |
| deep link | a link that opens a specific screen inside an app |
| custom URL scheme | a made-up link scheme like chaipay:// that any app could register |
| Android App Links | HTTPS deep links verified against the website's assetlinks.json |
| universal links | iOS's verified HTTPS deep links |
| WebView | a browser window built into an app |
| JavaScript bridge | page JavaScript calling native app code |
| rooting / jailbreaking | removing OS restrictions to gain full control |
| root / jailbreak detection | app checks for signs of a modified phone; a signal, not proof |
| mobile threat defence (MTD) | continuous detection of mobile threats feeding MDM |
| MDM | mobile device management: central control of company devices |
Summary
- Phones run many untrusted apps; the sandbox keeps each one in its own room.
- Runtime permissions let the user decide; apps should ask late, ask little, and cope with "deny".
- App signing proves updates come from the same developer; store review filters many bad apps.
- The OWASP Mobile Top 10 (2024) names the common risks; MASVS turns them into requirements and MASTG into tests.
- Secrets live in the Android Keystore / iOS Keychain, never in plain files or the app's code.
- Pinning blocks interception through extra CAs; pin a backup key.
- Deep links and WebViews are untrusted input: validate, confirm, verify App Links, allowlist pages.
- Root/jailbreak detection is a signal; MTD watches the fleet.
- Next episode: email security.
Sources (fetched 14 Nov 2026)
- OWASP Mobile Top 10 project: https://owasp.org/www-project-mobile-top-10/
- Indusface, OWASP Mobile Top 10 2024 (final release list): https://www.indusface.com/blog/owasp-mobile-top-10-2024
- OWASP MASVS v2.1 summary: https://opensecurityarchitecture.org/frameworks/owasp-masvs-v2
- Android Open Source Project, Runtime permissions: https://source.android.com/docs/core/permissions/runtime_perms
- Android Developers, Android Keystore system: https://developer.android.com/privacy-and-security/keystore
- Android Developers, Add intent filters for App Links: https://developer.android.com/training/app-links/add-applinks
- Apple Platform Security, Security of runtime process in iOS: https://support.apple.com/guide/security/sec15bfe098e