Annotated. Every entry says why you would open it, so you can pick the right one at 2 a.m. with a
client waiting.
The chapter's own claims are traceable to these sources. When you need to defend a finding —
"call() really does get no permission check" — this is where the proof lives.
Read these on cs.android.com, which gives you cross-references, blame and
per-release history. The navigation technique is in 07-AOSP.
Pentester's Note
Always pin the branch to the release you are testing. ContentProvider.java on main and on
android13-release differ in ways that matter — getTypeAnonymous() does not exist before API 33,
and the AttributionSource parameter threading through Transport arrived in Android 12. A
statement about "the framework" that is true on main and false on the device in your hand is a
statement that will be corrected in the remediation meeting.
You need to prove exactly where enforcement happens. The inner Transport class is the trust boundary — your subclass is never published over Binder, Transport is. The single most important file in this chapter. Read enforceReadPermission, enforceWritePermission, validateIncomingUri and, critically, call() — to see that it enforces nothing per-URI.
You are reasoning about the client side: query, openInputStream, openFileDescriptor, call, acquireUnstableProvider. Read acquireProvider vs acquireUnstableProvider before you write a fuzzer, so you understand why the stable variant kills your own process.
You are looking at a Binder transaction dump and need the transaction codes, or you want to see exactly what gets parcelled for a query. ContentProviderProxy is the client stub; ContentProviderNative.onTransact is the server dispatch.
You need to know precisely what * and # match, and to confirm that the matcher does not normalise .. in a path. It matches literally against uri.getPathSegments().
You are writing tooling that holds a long-lived handle instead of re-resolving the authority per call.
frameworks/base/core/java/android/net/Uri.java
You are arguing about what getLastPathSegment() can contain after percent-decoding. The answer to "surely a path segment cannot contain a slash" is in this file.
You need the authoritative answer to "can this UID reach this provider at all?". getContentProviderImpl() and checkContentProviderPermission() live here on modern releases. This is also where you see that resolving an authority starts the owning app's process. On older branches the same logic sits inside ActivityManagerService.java.
checkComponentPermission() — the function containing the two short circuits you must internalise: same-UID callers are allowed unconditionally, and non-exported components are denied to different UIDs regardless of held permissions.
You are investigating a URI-permission grant: how it is created, how it is checked, how FLAG_GRANT_PREFIX_URI_PERMISSION widens it, and how persisted grants are serialised. The counterpart to dumpsys activity permissions.
You want the record structure behind a grant — the (sourceUid, targetUid, GrantUri) key — so you can reason about exactly what a grant does and does not cover.
installContentProviders() and acquireProvider(). Read it to confirm the ordering claim the chapter makes: providers are installed beforeApplication.onCreate(). This is why a stub provider is the standard library auto-initialiser trick.
resolveContentProvider and the parsed ProviderInfo — the ground truth for exported, readPermission, writePermission, pathPermissions and grantUriPermissions, which is what dumpsys package prints. Trust this over your decompiler.
You are writing the remediation. setStrict(), setStrictColumns(), setStrictGrammar() and setProjectionMap() are the two-line fix for the entire injection class. Read the implementation so you can tell a developer why it works rather than asserting that it does.
You are deciding whether a decompiled call is safe. rawQuery(sql, args) binds only ? placeholders; query(table, columns, selection, selectionArgs, …) does the same. Neither protects a concatenated column list or ORDER BY.
You want to understand why a Cursor crossing a process boundary is shared memory rather than a Binder payload, and why a leaked Cursor leaks a file descriptor in both processes.
You need parseMode()'s exact mapping from "r"/"w"/"rwt" to open flags, and the FD-passing mechanics that make an openFile traversal a genuine sandbox bypass rather than a mediated data leak.
AndroidX androidx/core/content/FileProvider.java (source in the AndroidX repository; also readable in any app's decompiled output)
You are deciding whether a FileProvider finding is in the library or in the configuration. getUriForFile() and openFile() both canonicalise and check containment, so the bug is almost always the <paths> resource, a hand-rolled clone, or an app code path that lets an attacker choose the File.
Your target uses the Storage Access Framework. DocumentsProvider is a ContentProvider subclass with its own queryChildDocuments/openDocument surface and its own traversal opportunities.
You want to know exactly what content query --projection does with your string, which flags exist on the release you are testing, and which operations the CLI cannot express. Reading this file once saves you from concluding "the provider rejected it" when the truth is "the CLI never sent it".
Under the Hoodcontent is a Java program launched by a shell wrapper (/system/bin/content) that runs under the
shell UID with app_process. It builds a real ContentResolver against the shell's own identity.
That is precisely why it is not an attacker simulation — the identity it uses is UID 2000, which
holds privileges no third-party app has. The source is where you confirm that, rather than taking
the chapter's word for it.
The element chapter 32-Manifest audits in depth. Read it before claiming a path is protected — a <path-permission> can widen access, and unmatched paths fall back to the provider-level permission rather than being denied.
Google's own wording for "do not export unless you must". Quoting the vendor's guidance back at a developer is more persuasive than quoting a pentester.
The reachability tool. Its agent is an ordinary unprivileged app, so a Drozer result is evidence in a way an adb shell result is not. app.provider.info, app.provider.finduri, app.provider.query, app.provider.read, scanner.provider.injection, scanner.provider.traversal. Note the gaps: no call() module, and the injection scanner does not test sortOrder.
Server-side observation: hook ContentProvider.query/openFile/call and SQLiteDatabase.rawQuery to see what the provider did with your input. See ../scripts/hook-provider.js and 53-Frida.
android hooking watch class_method … --dump-args --dump-backtrace. The backtrace is what tells you whether a query came from the app's own UI or from a Binder thread serving an external caller. See 54-Objection.
Reading the provider's query, openFile and call implementations. Obfuscation cannot hide them — the signatures override framework methods. See 56-JADX.
Decoding the merged manifest and res/xml/*.xml, which is where the FileProvider<paths> file lives under a name you cannot guess.
aapt2 dump xmltree
Android SDK build-tools
The independent second opinion on the binary manifest. (type 0x12)0xffffffff is true, (type 0x12)0x0 is false. Disagreement with apktool is itself a finding.
Fast first pass over a corpus. Blind to sortOrder injection, call() methods, traversal requiring canonicalisation analysis, and deputy chains. See 55-MobSF.
sqlite3
host
Opening a database you pulled through a traversal — with its -wal and -shm files present so SQLite replays them.
Warning — on citing vulnerability identifiers
This chapter deliberately describes vulnerability classes rather than naming CVE IDs or linking
bug bounty reports. Provider bugs are numerous, version-specific and frequently reported under
vendor-internal identifiers, and a misattributed CVE in a client report costs you more credibility
than omitting the citation entirely. When you need a specific reference, pull it from the
Android Security Bulletin for the affected
release, and quote the bulletin's own wording.
Monthly, authoritative. Read for the pattern of which components recur, not to memorise identifiers. Provider and URI-grant issues appear regularly under the Framework component.
What Google itself considers a reportable provider vulnerability and at what severity. Useful for calibrating your own severity ratings against an external standard.
The best structural account of the permission model that providers sit inside. Dated in specifics, still correct in shape.
The Android Hacker's Handbook — Drake et al.
Historical, but the IPC attack methodology chapters remain a good model for how to reason about component reachability.
Android Internals: A Confectioner's Cookbook — Jonathan Levin
For the Binder and system_server layers underneath everything here.
The Tangled Web / general confused-deputy literature
If you want the theory behind §5.4 rather than the recipe. The confused-deputy problem was described by Norm Hardy in 1988; the paper is short and worth reading once.
The declaration-side audit. Chapter 32 owns permission precedence, <path-permission>, <grant-uri-permission> and the <paths> resource as manifest objects; this chapter owns runtime exploitation. 32-Manifest/labs/lab-04-provider-surgery.md is the companion to this chapter's labs — do it first if you have not.
The content and dumpsys command reference, and lab-03-exported-sweep.md, which is the general form of the reachability discipline applied to all four component types.