Skip to content
XSS Write-up Advanced

Malvertising’s New Threat: Exploiting Trusted Google Domains

Attackers compromised e-commerce sites and injected malicious scripts that abuse JSONP endpoints on trusted Google domains to bypass Content Security Policy and redirect shoppers to fake payment pages. The scheme lets attackers steal credit card details while hiding behind the credibility of legitimate brands and clean ad placements.

medium.com

Published on medium.com

By Moriya Pedael in Malvertising, Security Research

Moriya Pedael, 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 vulnerable sites allowed script sources from Google domains in their Content Security Policy, and certain Google JSONP endpoints could be made to return attacker-controlled JavaScript, so injected scripts could execute and redirect users.

Impact

Shoppers could be redirected to fake payment pages and tricked into disclosing credit card details, though the text notes the scale of the current attack remains small.

What the attacker needed

Compromised e-commerce site backend; victim visits the compromised site; site CSP allows Google domains

The fix

The text says the Ray-Ban site has since remediated the issue, but it does not describe a general fix; sites should avoid relying on JSONP endpoints from trusted domains and should review CSP allowances.

How it was found

  1. Attackers compromise the backend of a legitimate e-commerce site.
  2. They inject obfuscated JavaScript that makes JSONP calls to Google domains.
  3. The injected script executes in shoppers' browsers, bypassing CSP.
  4. Shoppers are redirected to a fake payment page on an attacker-controlled domain.

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 JSONP endpoint is a way for a website to fetch data from another domain by loading it as a script, which the browser will run automatically. Because many sites trust Google domains in their security policy, an attacker who can make a Google endpoint return malicious script can run code on the victim site. Here, attackers first broke into online stores, then used that trust to send shoppers to fake payment pages where card details were stolen.

What is XSS?

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.

Similar reports

View all

Same bug class and techniques, clearest first.

Cross-site scripting (XSS)

The lesson behind this report.

Script an attacker supplies runs in another user's browser, on the target's origin, with that user's session.