Skip to content
Misconfiguration Disclosed report Intermediate CVE-2020-26975

Missing restricted header check in Browser.EXTRA_HEADERS

Firefox for Android accepted a bundle of extra headers from an intent sent by another app without checking them against the list of forbidden headers. A malicious app could therefore inject a Cookie header into a request, which the report says could lead to session fixation.

Pedro Oliveira Follow

Originally disclosed on Mozilla

  • Fixed in 57 days
  • Paid in 2 months
  • Disclosed after 57 days

Created attachment 9171952 poc.apk

Summary

Missing restrictions in the way Mozilla Firefox for Android deals with headers from Browser.EXTRA_HEADERS allow a malicious application to inject sensitive headers in a request such as cookies, leading to session-fixation.

Environment

  • Device: HTC m8
  • OS version: Android 9
  • Package name: org.mozilla.firefox
  • App version: 79.0.5 (versionCode 2015758619)

Proof of concept

Pre-conditions:

  • PoC installed
  • Python3 installed
  • Mozilla Firefox installed
  • ngrok (optional for easy tunneling)

Steps:

  1. Start the server.py (see attachments) using the following command:
$ python3 server.py
  1. Start PoC app in the device
  2. Type the URL of the server (step 1) in the EditText of the application
  3. Tap "Start"

Result

A webpage opens in Firefox containing the Headers of the request. Cookie header can be seen there.

Expected result

Restricted headers should not be allowed to be set.


Detailed explanation

When the user taps in Start in the malicious app, the following intent is fired:

Kotlin
val intent = Intent(Intent.ACTION_VIEW)
intent.putExtra("android.support.customtabs.extra.SESSION", true)
intent.data = Uri.parse(edit.text.toString())
intent.`package` = "org.mozilla.firefox"
val bundle = Bundle()
bundle.putString("Cookie", "cookie_here")
bundle.putString("Sec-Fetch-Site", "same-site")
intent.putExtra(Browser.EXTRA_HEADERS, bundle)

This intent accepts a Bundle of headers the user wants to inject in the request. However, there are no restrictions to which headers can be set here.

According to this list, there are several headers that shouldn't be changed.

In this attack, these are passed to the server.

The server attached only prints the headers from the request.


Vulnerable code


Remediation

  • These headers should be cross checked with the list of forbidden headers.

Attachments

https://drive.google.com/drive/folders/1WR0oFzcxM568IB5GH-TG_G3k-TZP1x3Y?usp=sharing

  • server.py - Python3 HTTP server
  • poc.zip - Source code of the PoC
  • poc.apk - Compiled Android binary
  • video.mp4 - Video showing the exploit in action

Impact

Cookies can be changed, leading to session fixation.

Other impact of changing the forbidden headers apply.

The original report as published on Mozilla's Bugzilla, by Pedro Oliveira. Images and videos are our own copies; raw HTML is shown as text. View it on Mozilla's Bugzilla.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

The custom tab intent processor read the extra headers bundle and passed it on without checking the header names against the forbidden header list.

Impact

Cookies could be changed, which the report says could lead to session fixation, and other forbidden headers could also be altered.

What the attacker needed

Malicious app installed on the device; Firefox for Android installed; victim taps Start in the malicious app

The fix

The headers should be cross-checked against the list of forbidden headers before being applied.

How it was found

  1. Start the attached Python HTTP server that prints request headers.
  2. Open the proof-of-concept app on the device.
  3. Enter the server URL in the app's text field.
  4. Tap Start, which fires an intent to Firefox carrying a header bundle.
  5. Observe the opened page showing the injected Cookie header.

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 report has not been written yet. The Original tab links to the source.

Android apps can ask other apps to open a web page by sending a message called an intent. Firefox for Android let the sending app attach extra HTTP headers, which are pieces of information sent with every web request, and did not block sensitive ones such as Cookie, the value that keeps you logged in. A malicious app could use this to plant its own cookie value in the browser's request.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More by Pedro Oliveira

View all

4 more disclosed reports, best first.

More from Mozilla

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.