Android security tags, read closely by Lightrion

CVE-2025-48579 AI-generated analysis

platform/packages/providers/MediaProvider, MediaProvider.java (update and getMediaUri call paths)

AI-generated: written from the bulletin and the fixing diffs by claude-fable-5-1, then checked against the code by claude-opus-5-5 (4 corrections). Verify against the commit before relying on it.

MediaProvider now restores the cleared calling identity before rethrowing when ContentUris.parseId throws NumberFormatException in updateInternal (and, in the 15/16 commits, before throwing IllegalArgumentException for an unsupported authority in getResultForGetMediaUri), so these exceptions no longer leave MediaProvider's own identity in effect.

Root cause

In MediaProvider#updateInternal, the code calls clearLocalCallingIdentity() and then computes genericUri with MediaStore.Files.getContentUri(volumeName, ContentUris.parseId(uri)). This call is not inside any try/finally. If the URI's ID segment is not a valid long, ContentUris.parseId throws NumberFormatException and the method exits without calling restoreLocalCallingIdentity(token), so the cleared (provider) local calling identity stays in effect. Per the commit message and the 15/16 diffs, MediaProvider#getResultForGetMediaUri had the same flaw. When the document URI authority is neither MediaDocumentsProvider.AUTHORITY nor DocumentsContract.EXTERNAL_STORAGE_PROVIDER_AUTHORITY, it throws IllegalArgumentException("Provider for this Uri is not supported.") without calling restoreCallingIdentity(token).

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to March 2026 · Findings