Skip to content
SQL injection Write-up Intermediate

200 Bug Bounty Payouts Exploiting Content Providers With Sql Injection

An Android app's content providers were found to be vulnerable to SQL injection through the selection and projection parameters of content URIs. An attacker with a malicious app on the same device could read, insert, and delete data in the app's SQLite database.

Raj Prasad Kuiri Follow

Published on infosecwriteups.com

After successfully installing the dozer we will initiate the further steps for exploitations

Raj Prasad Kuiri, on infosecwriteups.com

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 content provider passes user-supplied selection and projection values directly into SQLite queries without parameterisation.

Impact

An attacker could read, insert, and delete data in the app's database, but only if they can run a malicious app on the same device.

What the attacker needed

Malicious app installed on the same device; target app has exported content providers

The fix

The app should restrict access to its content providers with permissions and use parameterised queries instead of building SQL from URI parameters.

How it was found

  1. Find the target app's package name.
  2. Start Drozer and connect the console.
  3. Enumerate the app's attack surface to find content providers.
  4. List details of all content providers.
  5. Scan for accessible content URIs.
  6. Test the URIs for SQL injection and confirm with database errors and version query.

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 share data with other apps through components called content providers. If an app builds database queries from untrusted input without cleaning it, another app on the phone can trick it into running extra database commands. This lets the attacker read or change the app's private data.

What is SQL injection?

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.

Similar reports

View all

Same bug class and techniques, clearest first.

SQL injection

The lesson behind this report.

Input reaches a database query as code, letting an attacker read or change data the application never meant to expose.