Skip to content
CORS Write-up Intermediate

Reading Your Emails With A Read&Write Chrome Extension Same Origin Policy Bypass (~8 Million Users Affected)

The Read&Write Chrome extension lacked origin checks on messages from web pages, allowing any site to call privileged background APIs. An attacker could use one API to fetch arbitrary URLs with the victim's cookies and read cross-origin responses, such as Gmail emails.

Matthew Bryant Follow

Published on thehackerblog.com

{{media:0}}

Matthew Bryant (@IAmMandatory), on thehackerblog.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

The extension's content script forwarded postMessage events from any web page to the background page without validating the sender's origin.

Impact

An attacker could read data from other websites using the victim's authenticated sessions, such as Gmail emails, if the target is accessible via HTTP GET without special headers.

What the attacker needed

Victim has vulnerable extension installed; victim visits attacker's webpage; victim is logged into target site

The fix

The extension was fixed by adding origin checks and moving logic to content scripts with isTrusted validation.

How it was found

  1. The extension injects a content script into all HTTP and HTTPS pages.
  2. The content script listens for postMessage events and forwards them to the background page.
  3. The background page handles a request to fetch a URL and returns the response.
  4. An attacker hosts a page that sends a crafted postMessage to fetch a target URL.
  5. The response is posted back to the page, allowing the attacker to read it.

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.

A browser extension can add features to web pages. This extension let any website send it commands without checking where they came from. One command made the extension fetch a web address using the user's logged-in sessions, so a malicious site could read the user's emails from another site.

What is CORS?

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

More by Matthew Bryant

View all

6 more disclosed reports, best first.

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.