Lesson 12 of 13 · 14m
The Bugs You'll Actually Find
addJavascriptInterface RCE, intent redirection, overlay tapjacking, StrandHogg task hijack, pasteboard snooping, and scheme collisions — the recurring platform bug classes with their CVEs.
WebView: the RCE that wouldn't die
addJavascriptInterface injects a Java object into the page's JavaScript context. Below API 17 the bridge was unannotated — every public method on the injected object was callable, and reflection from JS reached Runtime.exec through methods nobody annotated. That's CVE-2012-6636, and it was exploited by ad SDKs broadly enough that API 17 made @JavascriptInterface mandatory. The fix didn't remove the attack surface; it moved it to whatever you annotate — SDKs that bridge openFile, exec, or download methods are still a bridge to the OS, now with a blessing.
The rest of the WebView surface: setJavaScriptEnabled(true) on content you don't control; setAllowFileAccess enabling file:// loads inside the WebView sandbox; setAllowFileAccessFromFileURLs/setAllowUniversalAccessFromFileURLs — deprecated at API 30, defaulted off since Jelly Bean — which let JS in a file:// page read the app's private storage (/data/data/<pkg>/) via XHR; and loadUrl("javascript:...") or deeplink-driven loadUrl letting an attacker choose the page. Microsoft's TikTok writeup (CVE-2022-28799, May 2022) chained a non-verified deeplink into exactly this: navigate a first-party WebView to an attacker URL, inherit its JS bridge.
The IPC bugs from lesson three, weaponized
Intent redirection — launching a caller-supplied Intent — is a confused-deputy primitive into non-exported components. PendingIntent with an implicit mutable base lets the filler choose action, component, data. Content provider openFile traversal with percent-encoded ..%2f reads app-private files — Uri.getPath() decodes before your startsWith(root) check runs, so check the decoded path against the canonical root. And taskAffinity/reparenting is StrandHogg (Promon, December 2019) and StrandHogg 2.0 (CVE-2020-0096): a hostile activity parks inside the victim's task and phishes from inside the real app's task card. Android 10/11 restricted task reparenting; the class lives on wherever an app leaves reparentable surfaces.
Overlay and tapjacking
SYSTEM_ALERT_WINDOW draws on top of everything. Cloak & Dagger, the 2017 Oakland paper by Fratantonio et al., showed overlay + BIND_ACCESSIBILITY_SERVICE was a complete compromise: steal keystrokes, overlay phishing UI, install apps silently. CVE-2017-0752 — the Toast overlay attack — drew a TYPE_TOAST window over system UI and even the lock screen, no permission prompt involved. Banking trojan families (Anatsa, Hook) still live on this surface. The defenses: setFilterTouchesWhenObscured(true) on sensitive views rejects touches that passed through an obscuring overlay; Android 12 blocks touches through untrusted overlays platform-wide; Android 14 hardened the opacity limits again. On your login screen, the flag is still worth writing.
The iOS side of the list
- Pasteboard.
UIPasteboard.generalwas readable by any foreground app until iOS 14's banner exposed the snoopers (TikTok got caught June 2020). iOS 16 requires consent for programmatic paste. Don't put secrets on it; clear it after use. - Custom schemes. Any app can register a scheme you registered; collision resolution is undocumented — custom-scheme callbacks are attacker-controlled input. Universal Links via
apple-app-site-associationare the verified path. - Keyboard cache and snapshots.
secureTextEntry/textContentTypekeep sensitive input out of autocorrect's learned dictionary; the app-switcher snapshot persists on flash unless you blur onapplicationDidEnterBackground. - App Groups.
group.com.team.sharedcontainers andkeychain-access-groupsdeliberately share state between your apps — audit who else has the Team ID's signing keys before sharing secrets there. LSApplicationQueriesSchemes. The 50-entry cap is also a ceiling on fingerprinting; iOS 9+ madecanOpenURLrequire the declaration precisely because silent scheme probing enumerated installed apps.
Practice
On Android: exported=false by default, PendingIntents immutable with empty bases, filterTouchesWhenObscured on auth/payment screens, WebView surface reduced to setJavaScriptEnabled only where required, no file access, no bridges to privileged methods, verified App Links. On iOS: Universal Links only, secrets off the pasteboard, blur on background, scoped App Groups. Then grep the artifact — addJavascriptInterface, allowFileAccess, loadUrl, exported — because the manifest and the decompile are the audit, and they're exactly what the other side reads first.
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.