Lesson 2 of 13 · 12m
The Sandbox and the Permission Lie
Every Android app is a separate Linux UID under SELinux and seccomp; the permission list gates framework APIs, not what the app does with Accessibility and overlay powers users hand it.
Every app is a separate Linux user
Android doesn't emulate a sandbox — it reuses the Linux one. Each installed package gets a UID (u0_aXX, i.e. UID 10000+), its own /data/data/<pkg> directory mode 0700, and a process forked from zygote that lands in the SELinux domain untrusted_app. Since Android 8.0, zygote children also inherit a seccomp-bpf filter that blocks syscalls the platform never intends apps to call — swapon, init_module, most of keyctl. Reading another app's files is an EACCES at the VFS layer, not a policy check in Java.
A useful detail most people miss: INTERNET isn't a Java-level check at all. The kernel gates socket() behind the inet supplementary group — apps without the permission never get the gid, so no framework bug can hand them a socket. The enforcement lives below everything an attacker can hook with Frida.
iOS runs the older, stricter version of this model. Every third-party app launches under the seatbelt sandbox profile into a container at /var/mobile/Containers/Data/Application/<uuid>; capabilities the sandbox doesn't give you arrive via entitlements — signed key-value claims in the code signature like com.apple.developer.associated-domains or keychain-access-groups. Private entitlements (com.apple.private.*) exist and work — Uber famously shipped com.apple.private.apple-explicit-... to screenshot the display for its Apple Watch app in 2017, with Apple's blessing, discovered when Will Strafach dumped the binary's entitlements. On Android you can't grant yourself platform permissions; on iOS you can't grant yourself private entitlements without Apple's signature.
Permissions are not the sandbox
Here is the wrong model: "the permission list describes what the app can do." It describes what the app can ask the framework for — camera frames, contacts rows, fine location. It says nothing about what the app does with inputs it legitimately holds, and it badly understates the real escalation paths.
The actual escalation paths have names. BIND_ACCESSIBILITY_SERVICE lets an app read every widget on every screen and inject taps — that is the entire business model of the Android banking trojan families: Gustuff (2019), Anatsa/TeaBot (2021), Hook (2023) all stole banking credentials with zero "dangerous" permissions users were suspicious of, because Accessibility is a settings toggle users flip for a "dark mode" helper and forget. SYSTEM_ALERT_WINDOW draws over other apps' screens — the overlay half of every tapjacking attack. Google felt the pattern too: in January 2019 Play restricted READ_SMS/READ_CALL_LOG to apps whose core function needs them, and the permission-abuse ecosystem lost its two best exfil channels overnight.
iOS hides the same surface differently: TCC (Transparency, Consent, Control) gates photos, contacts, microphone, pasteboard consent, and local-network access through per-app prompt rows in TCC.db. The prompts are the boundary — once granted, nothing mediates use.
What scoping actually changed
Pre-Android-10, READ_EXTERNAL_STORAGE meant "read everyone's files" — /sdcard was a shared pool, so a flashlight app could read WhatsApp backups. Scoped storage, enforced for apps targeting API 30, replaced the pool with per-app media directories plus MediaStore/SAF picks; API 33 split the permission into READ_MEDIA_IMAGES/VIDEO/AUDIO. The fix was architectural, not a stronger prompt — the prompt approach had already failed.
Certifi-gate (2015) is the boundary case worth remembering: preinstalled remote-support tools from carriers shipped privileged plugins reachable through local ports — apps with nothing but INTERNET could dial vendor-grade device control. The sandbox held; the privileged surface inside it didn't.
Practice
- Audit requested permissions against actual feature use; every unused dangerous permission is liability you're carrying.
- Treat Accessibility, overlay, device-admin, and
REQUEST_INSTALL_PACKAGESas your app's real privilege tier, not the runtime-permission list. - On iOS, dump entitlements (
codesign -d --entitlements :- App.appon macOS, orldid -eon-device) during review — that's where the real capability grant lives. - Don't use the permission list as the security argument. The argument is sandbox UID + entitlement set + what your IPC surface answers to.
Was this lesson helpful?
Keep reading
Related articles from the SudoSecurity blog.
They Got Root on a Fully Patched Ivanti VPN and the Integrity Checker Said Everything Was Fine
Volexity caught an attacker chaining zero-days into unauthenticated root on an Ivanti Connect Secure appliance running the latest build. The payload never touched disk, commands rode in over the same HTTPS requests as the exploit, and Ivanti's Integrity Checker reported no modifications.
Gitea Shipped 21 CVEs in One Release and Eleven of Them Are the Same Bug
Gitea 28.3.0 landed November 1 with twenty-one CVE fixes. Read the list and a pattern jumps out: more than half are the same failure repeated across different route handlers, where a token scoped to public data gets handed private data anyway. That's not twenty-one mistakes.
php2shell: The PHP Bug That Fires Before Your Code Runs
Two critical PHP flaws landed October 21 and were in CISA's exploited-vulnerabilities catalog five days later. The 9.2 score isn't the part that should bother you. It's where the bug lives — it goes off while PHP is still assembling $_POST, before a single line of your application has run.
A Certificate Authority's Private Keys Were the Numbers 4, 56 and 66
Eight eMudhra intermediate CA keys turned out to be recoverable from their own public certificates. Not stolen — computable, because the key generation produced almost no entropy. A researcher pulled all eight in under a second and signed a message with each one to prove it.