Skip to content
Leaked secrets Write-up Beginner

Contentful Access Token Disclosure in Android APK

A Contentful access token and space identifier were hardcoded in the Android APK's BuildConfig file. An attacker could use the token to query Contentful's API and retrieve the application's stored content.

Cyberali Follow

Published on medium.com

Hello, My name is Ali, a Penetration Tester and a Certified Ethical Hacker. It’s my first write-up of 2022 on Android APK Pen testing.

Cyberali, on medium.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 Contentful access token was embedded in the app's build configuration instead of being kept server-side or protected.

Impact

An attacker could retrieve the application's content stored on Contentful, as the token granted access.

What the attacker needed

Download the APK; Static analysis tools

How it was found

  1. Download the Android APK.
  2. Perform static analysis by reviewing the code.
  3. Locate the BuildConfig file in the APK.
  4. Find the CONTENTFUL_ACCESS_TOKEN and CONTENTFUL_SPACE keys.
  5. Read Contentful documentation to learn how to authenticate.
  6. Use the token as a query parameter in a curl request to retrieve content.

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.

When developers build an app, they sometimes leave secret passwords or keys inside the app's code. Anyone who downloads the app can open it up and read those secrets. Here, a key for a content service was left in the app, so anyone could use it to read the app's content.

What is Leaked secrets?

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.

More by Cyberali

View all

3 more disclosed reports, best first.

Similar reports

View all

Same bug class and techniques, clearest first.

Leaked secrets and credentials

The lesson behind this report.

Keys, tokens or passwords left in public code, apps, logs or responses, that grant real access.