polyfill.io serves altered code to more than 100,000 sites

ATG-class event25 June 2024

Four months after the sale, the address began serving altered code through the channel its dependent sites had always used, sending some mobile visitors to gambling and scam sites. It is the clearest public case of Attack the Glass.

Position
A long-trusted third-party script address, held by its buyer
Reach
More than 100,000 sites (Sansec); 384,773 hosts still referencing it on 2 July 2024 (Censys)
Category
CDN Compromise
Thread
The polyfill.io operator

What happened

On 25 June 2024 Sansec reported that cdn.polyfill.io was injecting malware into mobile devices through any site that embedded it, and put the exposure at more than 100,000 sites. The altered code filtered its targets. It checked the request headers and the device type, checked the device type again in the browser, and gated on the referring page and the local time. Visitors with administrator sessions or open developer tools were avoided. Those who passed were redirected to gambling and scam sites.

Google began warning advertisers about affected pages on 26 June. Cloudflare rewrote links to its own mirror for sites behind it. Namecheap, the registrar, suspended the domain on 27 June. On 2 July Censys still counted 384,773 hosts referencing the address, 182 of them on .gov domains. Estimates of the reach differ because they count different things: sites, hosts, or pages.

The ATG nexus

Every condition the research describes is present. A position of trust was bought rather than broken. It was held quietly for months. When it was used, the altered code arrived through the legitimate publishing channel, from the same address, inside each dependent site's own pages. The code decided per request who would receive it, and it hid from the people most likely to look. Nothing a security tool is built to catch would have fired.

The Introduction makes the further point: the operation was crude. A redirect is about the most noticeable thing altered code can do. An operator holding the same position could have changed what those sites said, for chosen readers, and left nothing behind.

Limits of the comparison

The payload in this case was a redirect, which the people it reached could see. The counts of affected sites are estimates of exposure, not of victims, and the number of people actually redirected is not known.

On this site

Sources

  1. Polyfill supply chain attack hits 100K+ sitesSansec, 25 June 2024Primary source
  2. Treasury Takes Action Against Major Cyber Scam FacilitatorUS Department of the Treasury, 29 May 2025Primary source
  3. Polyfill.io Supply Chain Attack: Digging into the Web of Compromised DomainsCensys, 2 July 2024
  4. Polyfill.io supply chain attack (link post quoting the creator’s warning)Simon Willison’s Weblog, 25 June 2024

Back to this event on the timeline