Protect your code from the Polyfill supply chain attack
Blog post from Semgrep
In 2024, a significant security incident occurred involving the domain polyfill.io, a widely used CDN service for adding modern web functionality to older browsers, which was compromised to deliver malware after being acquired by a malicious actor. This breach affected over 100,000 websites by injecting harmful JavaScript code, redirecting users, and circumventing security measures, prompting entities like Google to notify impacted parties and identify similar threats from other CDNs. The incident underscored the risks associated with legacy software dependencies, leading to a recommendation for developers to replace polyfill.io with Cloudflare's alternative, which has replicated the original functionality. The Semgrep Security Research Team developed a rule to detect and mitigate the use of polyfill.io in applications by scanning repositories and encouraging a switch to safer alternatives, highlighting the importance of updating and securing web technologies to prevent future vulnerabilities.