Google Messages Avatarcontentprovider Contacts Bypass
Google Messages exposed an exported content provider that accepted a caller-supplied URI and fetched it using Messages' own permissions, allowing an app without Contacts permission to read protected contact photos. An attacker could enumerate numeric contact IDs and extract photos, though not full contact records.
blog.devploit.dev
Published on blog.devploit.dev
What happens if an app without READCONTACTS asks Google Messages for Android to load a Contacts photo for it?
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the exported AvatarContentProvider dereferenced arbitrary caller-controlled content:// URIs using Google Messages' own permissions without verifying the caller could access the source.
Impact
An installed app without Contacts permission could silently extract contact photos stored behind Android's Contacts permission model, limited to photos rather than full contact records.
What the attacker needed
Attacker app installed on same device; Google Messages has Contacts permission; no root or special permissions needed
The fix
The issue was fixed by Google on June 12, 2026; the report recommends avoiding exported providers that fetch arbitrary caller-supplied URIs under the app's own privileges.
How it was found
- Install a proof-of-concept app that does not request READ_CONTACTS or WRITE_CONTACTS.
- Attempt to read a contact photo directly from the Contacts provider; observe a SecurityException.
- Send the same protected Contacts URI through the Google Messages AvatarContentProvider using the m query parameter.
- Receive image bytes (PNG) from the provider, confirming the bypass.
- Iterate numeric contact IDs and compare responses against the stable default avatar to identify real photos.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
Android apps can ask other apps for data through content providers. Normally, an app without permission to read contacts cannot access contact photos. Here, Google Messages had that permission and would fetch any photo address given to it, then pass the image back to the requesting app, effectively letting the requester bypass the permission check.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.