Skip to content
CORS Write-up Intermediate

Android Browser Same Origin Policy Bypass < 4.4 - CVE-2014-6041

The stock Android Browser before version 4.4 failed to enforce the same origin policy correctly, so a page from one origin could read content belonging to another origin. An attacker could use this to read responses and local files and to bypass frame busting code.

Rafay Baloch Follow

Published on rafaybaloch.com

The original lives on rafaybaloch.com

We do not hold its text, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 4 min read.

What the report shows

The report covers a same origin policy (SOP) bypass in the stock Android Browser on versions below 4.4, tracked as CVE-2014-6041. The write-up is structured as an introduction, a description of the SOP bypass, a proof of concept, two sections on reading the response (one of them also sending it to an attacker's domain), a section on bypassing frame busting code, a list of affected versions, and per-device confirmations.

From the original on rafaybaloch.com

The proof of concept is given as a single numbered step, which links to a Blogger null URL:

Text
1. [vagugebiweja:7](https://www.blogger.com/null)

The report then describes two capabilities built on the bypass: reading the response of a cross-origin request, and reading that response and sending it to an attacker's domain. A further section is titled bypassing frame busting code.

The affected versions section is followed by confirmations on specific handsets. The report has sections headed Samsung Galaxy S3, Motorola Razr, Sony Xperia Tipo, and HTC Evo 3D and Wildfire.

From the original on rafaybaloch.com

The report closes with pointers to related work: Haru Sugiyama found an additional technique to read local files using this trick, a second SOP bypass vulnerability was posted separately, and a Content Security Policy bypass in browsers prior to 4.4 was posted by abusing null bytes. It also has a press coverage section. The report gives no bounty amount, no severity rating and no fix details.

Root cause

The report frames the issue as a same origin policy bypass in the Android Browser below 4.4. The report does not describe the underlying cause. The report does not go into the parser or engine internals behind it.

Impact

Within the report's own framing, an attacker can read the response of a cross-origin request and forward it to a domain they control. That combination matters for pages that rely on the SOP and on frame busting to keep their content away from other sites. The report does not claim specific data classes or named victims.

How this kind of bug works

The same origin policy is the browser rule that lets a document read responses only from its own scheme, host and port. A bypass means some code path, often in URL parsing, redirect handling, encoding or document type handling, resolves the origin of a resource differently from the origin the browser uses when deciding whether a read is allowed. When the two disagree, a page from one origin ends up able to read another origin's response. Frame busting is a separate, script-level defence: a page checks whether it is the top window and navigates away if not. It is not a browser guarantee, so any technique that stops the check from running, or that keeps the framed document from noticing, defeats it. Defences are the browser's own origin checks, correct handling of redirects and encodings, and server-side controls such as Content Security Policy frame-ancestors and the X-Frame-Options header, which do not depend on page script.

How to test for it

  1. Identify the browser and version under test, since this class is version-specific. The report scopes it to Android Browser below 4.4.
  2. Set up two origins you control: a victim page that returns a distinctive response, and an attacker page that tries to read it.
  3. From the attacker page, request the victim resource in each way the browser supports (direct fetch, frame, redirect, encoded URL variants) and attempt to read the response body.
  4. A positive result is the attacker page obtaining the victim response content that the SOP should have blocked. Record the exact browser build and device.
  5. For the frame busting angle, load a page that uses frame busting inside your frame and check whether it stays framed and whether its content can be read.
  6. Common false positives: content that is already readable because of permissive CORS headers, JSONP endpoints, or postMessage handlers; cached or same-origin copies; and behaviour that only appears with a proxy or extension altering requests. Confirm with a clean browser profile and a second origin.

How it is fixed

The report gives no fix details. For site owners, the durable fixes are server-side: send X-Frame-Options or a Content Security Policy frame-ancestors directive to control framing, and avoid relying on JavaScript frame busting alone.

Hunting notes

This bug class tends to hide in older or embedded browsers, vendor-specific WebViews, and any client that parses URLs itself. Recon signals include old browser versions in user agent strings, apps bundling an outdated WebView, and pages that depend on frame busting rather than headers. To make a report accepted, show a minimal pair of origins you control, the exact browser and device build, the response content obtained across the boundary, and a clear statement of what the SOP should have prevented. Keep the demonstration reproducible and avoid touching third-party data.

The original is short, so this covers everything it reports, then explains this kind of bug in general: how it works, how to test for it and how it is fixed. The general sections are about the bug class, not this target. Written with AI and checked against the original; the original is the record. 6 min read.

What happened, in plain words

This report is about a flaw in the built-in web browser that shipped with older Android phones, in versions below 4.4. The flaw is a bypass of the same origin policy, tracked as CVE-2014-6041. The same origin policy is the rule that stops one website from reading another website's data inside your browser. When that rule can be bypassed, a malicious page can read content it should never see.

The write-up is laid out in sections: an introduction, a description of the SOP bypass, a proof of concept, two sections on reading the response (one of which also sends it to an attacker's domain), a section on bypassing frame busting code, a list of affected versions, and confirmations on individual handsets.

From the original on rafaybaloch.com

The proof of concept is given as a single numbered step, which links to a Blogger null URL:

Text
1. [vagugebiweja:7](https://www.blogger.com/null)

That is all the report gives for the proof of concept itself. The rest of the write-up describes what the bypass lets an attacker do: read the response of a cross-origin request, and read that response and send it to a domain the attacker controls. A further section is titled bypassing frame busting code.

The affected versions section is followed by confirmations on specific handsets. The report has sections headed Samsung Galaxy S3, Motorola Razr, Sony Xperia Tipo, and HTC Evo 3D and Wildfire.

From the original on rafaybaloch.com

The report closes with pointers to related work: Haru Sugiyama found an additional technique to read local files using this trick, a second SOP bypass vulnerability was posted separately, and a Content Security Policy bypass in browsers prior to 4.4 was posted by abusing null bytes. There is also a press coverage section. The report gives no bounty amount, no severity rating and no fix details.

Root cause

The report frames the issue as a same origin policy bypass in the Android Browser below 4.4. The report does not describe the underlying cause. The report does not go into the parser or engine internals behind it.

Impact

Within the report's own framing, an attacker can read the response of a cross-origin request and forward it to a domain they control. That combination matters for pages that rely on the SOP and on frame busting to keep their content away from other sites. The report does not claim specific data classes or named victims.

In general, how this kind of bug works

The same origin policy is the browser rule that lets a document read responses only from its own scheme, host and port. Think of it as a building where each office can only open its own filing cabinet: the browser checks the address of the page asking and the address of the data being asked for, and refuses the read if they differ. A bypass means some code path, often in URL parsing, redirect handling, encoding or document type handling, resolves the origin of a resource differently from the origin the browser uses when deciding whether a read is allowed. When the two disagree, a page from one origin ends up able to read another origin's response.

Frame busting is a separate, script-level defence: a page checks whether it is the top window and navigates away if not. It is not a browser guarantee, so any technique that stops the check from running, or that keeps the framed document from noticing, defeats it. Defences are the browser's own origin checks, correct handling of redirects and encodings, and server-side controls such as Content Security Policy frame-ancestors and the X-Frame-Options header, which do not depend on page script.

In general, how to test for it

  1. Identify the browser and version under test, since this class is version-specific. The report scopes it to Android Browser below 4.4.
  2. Set up two origins you control: a victim page that returns a distinctive response, and an attacker page that tries to read it.
  3. From the attacker page, request the victim resource in each way the browser supports (direct fetch, frame, redirect, encoded URL variants) and attempt to read the response body.
  4. A positive result is the attacker page obtaining the victim response content that the SOP should have blocked. Record the exact browser build and device.
  5. For the frame busting angle, load a page that uses frame busting inside your frame and check whether it stays framed and whether its content can be read.
  6. Common false positives: content that is already readable because of permissive CORS headers, JSONP endpoints, or postMessage handlers; cached or same-origin copies; and behaviour that only appears with a proxy or extension altering requests. Confirm with a clean browser profile and a second origin.

In general, how it is fixed

The report gives no fix details. For site owners, the durable fixes are server-side: send X-Frame-Options or a Content Security Policy frame-ancestors directive to control framing, and avoid relying on JavaScript frame busting alone.

In general, hunting notes

This bug class tends to hide in older or embedded browsers, vendor-specific WebViews, and any client that parses URLs itself. Recon signals include old browser versions in user agent strings, apps bundling an outdated WebView, and pages that depend on frame busting rather than headers. To make a report accepted, show a minimal pair of origins you control, the exact browser and device build, the response content obtained across the boundary, and a clear statement of what the SOP should have prevented. Keep the demonstration reproducible and avoid touching third-party data.

Glossary

  • Same origin policy (SOP): the browser rule that lets a page read data only from its own scheme, host and port.
  • Origin: the combination of scheme, host and port that identifies where a page or resource comes from.
  • Cross-origin request: a request made from a page to a resource on a different origin.
  • SOP bypass: a flaw that lets one origin read another origin's data despite the same origin policy.
  • CVE-2014-6041: the identifier assigned to this Android Browser SOP bypass.
  • Android Browser: the stock web browser that shipped with older Android versions.
  • Proof of concept (PoC): a minimal demonstration that a flaw is real.
  • Response: the data a server sends back after a request.
  • Frame: a window inside a page that loads another page.
  • Frame busting: page script that tries to stop the page being loaded inside another site's frame.
  • Content Security Policy (CSP): a set of server-sent rules telling the browser what a page may load or be framed by.
  • frame-ancestors: a CSP directive that controls which pages may frame this page.
  • X-Frame-Options: a response header that tells the browser whether the page may be framed.
  • Null byte: a zero byte character, sometimes abused to confuse parsing.
  • CORS: a mechanism of headers that lets a server permit cross-origin reads.
  • JSONP: a technique that returns data as script, which can sidestep the SOP.
  • postMessage: a browser API for sending messages between windows of different origins.
  • WebView: an embedded browser component used inside apps.
  • User agent string: the text a browser sends to identify itself and its version.
  • False positive: a result that looks like a bug but has an innocent explanation.

More by Rafay Baloch

View all

4 more disclosed reports, best first.

More from Google

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

CORS misconfiguration

The lesson behind this report.

A permissive cross-origin policy lets another site read responses with the user's credentials.