Android security tags, read closely by Lightrion

CVE-2026-58821 AI-generated analysis

platform/packages/providers/MediaProvider, photo picker v2 search request database (SearchRequestDatabaseUtil)

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.

Replaces String.format()-built WHERE clause literals in the photo picker search request ID lookup (SearchRequestDatabaseUtil) with "?" placeholders and a selectionArgs array passed to SQLiteDatabase.rawQuery, so search text, mime types, media set id, authority and suggestion type are bound as parameters instead of being spliced into SQL.

Root cause

In SearchRequestDatabaseUtil.java, the private helper addWhereClause built each equality predicate with String.format(Locale.ROOT, " %s = '%s' ", columnName, value) and appended it via queryBuilder.appendWhereStandalone. addSearchRequestIDWhereClause called this helper for MIME_TYPES, SEARCH_TEXT, MEDIA_SET_ID, SUGGESTION_AUTHORITY and SUGGESTION_TYPE, taking the values from the SearchRequest object. The search request ID lookup (getSearchRequestID) then executed the result with database.rawQuery(queryBuilder.buildQuery(), null). Because the values (notably the search text) were placed inside single quotes in the SQL string with no escaping, a value containing a quote character could alter the structure of the query run against the picker database.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to November 2026 · Findings