Android security tags, read closely by Lightrion

CVE-2026-45518 AI-generated analysis

platform/frameworks/base (core/java/android/database/sqlite/SQLiteTokenizer) and platform/packages/providers/ContactsProvider (com.android.providers.contacts.util.SelectionBuilder)

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 (5 corrections). Verify against the commit before relying on it.

Adds an OPTION_CHECK_BRACKETS mode to android.database.sqlite.SQLiteTokenizer that rejects SQL fragments with unbalanced parentheses, and makes ContactsProvider's SelectionBuilder.addClause() validate every clause with it so a caller-supplied selection cannot close the parentheses that SelectionBuilder wraps around each clause.

Root cause

SelectionBuilder concatenates clauses as "(clause1) AND (clause2) ..." (see SelectionBuilderTest expectations such as "(A) AND (B)"). The base selection passed to the constructor is, per its javadoc, "typically the user supplied selection arg". addClause() only checked TextUtils.isEmpty() and stored the clause verbatim, so a selection containing unbalanced parentheses (for example the test input "1=1)) OR ((1=1") could break out of the wrapping parentheses and change how it combines with the other clauses. SQLiteTokenizer had no facility to detect this, and it also contained a bug where `options &= OPTION_TOKEN_ONLY` (compound assignment) cleared all other option bits when that check was reached.

How the fix works

Completeness

Behavior changes

Per major

Unknowns

Back to September 2026 · Findings