{"id":22989,"date":"2024-07-05T10:30:29","date_gmt":"2024-07-05T06:30:29","guid":{"rendered":"https:\/\/me-en.kaspersky.com\/blog\/polyfill-io-service-supply-chain-attacks\/22989\/"},"modified":"2024-07-05T10:30:34","modified_gmt":"2024-07-05T06:30:34","slug":"polyfill-io-service-supply-chain-attacks","status":"publish","type":"post","link":"https:\/\/me-en.kaspersky.com\/blog\/polyfill-io-service-supply-chain-attacks\/22989\/","title":{"rendered":"Remove Polyfill.io from your website"},"content":{"rendered":"<p>If your website uses the script from Polyfill.io, we recommend removing it ASAP: the service is sending <a href=\"https:\/\/www.bleepingcomputer.com\/news\/security\/polyfillio-javascript-supply-chain-attack-impacts-over-100k-sites\/\" target=\"_blank\" rel=\"nofollow noopener\">malicious code<\/a> to your visitors. This article explains what Polyfill.io is for, why it\u2019s become dangerous to use, and what you should do about it if you do use it.<\/p>\n<h2>What polyfills and Polyfill.io are<\/h2>\n<p>\nA polyfill is a piece of code that implements features otherwise unsupported by certain browser versions. This is typically JavaScript code that adds support for HTML5, CSS3, JavaScript API and other standards and technologies that spare web developers the headache of supporting exotic or outdated browsers. Polyfills saw their heyday in the 2010s as HTML5 and CSS3 gradually took over the Web.<\/p>\n<p>Polyfill.io is a service that helps automatically deliver polyfills that a browser requires for displaying a particular website.<\/p>\n<p>The service gained popularity both for its efficiency\u00a0(only the polyfills you need are loaded) and for its regular updates to the technologies and standards used. Straightforward implementation was a factor as well: all the developer needed to start using Polyfill.io was to add a short string to the website code in order to enable the service\u2019s script.<\/p>\n<p>Polyfill.io was originally created by the Financial Times web development team. In February 2024, the service, along with the associated domain and GitHub account, was sold to the Chinese CDN provider Funnull. It wasn\u2019t six months before trouble began.<\/p>\n<h2>Malicious code from cdn.polyfill.io<\/h2>\n<p>\nOn June 25, 2024, researchers at Sansec <a href=\"https:\/\/sansec.io\/research\/polyfill-supply-chain-attack\" target=\"_blank\" rel=\"nofollow noopener\">discovered<\/a> that cdn.polyfill.io had begun to deliver malicious code to users of websites that used Polyfill.io. The code used a typosquatted domain pretending to be Google Analytics\u00a0\u2014 [code] www.googie-anaiytics.com[\/code]\u00a0\u2014 to redirect users to a Vietnamese sports betting site.<\/p>\n<div id=\"attachment_51636\" style=\"width: 2714px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05102953\/polyfill-io-service-supply-chain-attacks-1.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-51636\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05102953\/polyfill-io-service-supply-chain-attacks-1.jpg\" alt=\"The sports betting site that Polyfill.io redirected users to \" width=\"2704\" height=\"1756\" class=\"size-full wp-image-51636\"><\/a><p id=\"caption-attachment-51636\" class=\"wp-caption-text\">The malicious code redirected the users of compromised sites to a sports betting site written in Vietnamese<\/p><\/div>\n<p>According to the researchers, this wasn\u2019t the first time that Polyfill.io had been caught spreading malicious code. Those who had noticed the dangerous behavior earlier tried <a href=\"https:\/\/web.archive.org\/web\/20240624110153\/https:\/github.com\/polyfillpolyfill\/polyfill-service\/issues\/2873\" target=\"_blank\" rel=\"nofollow noopener\">complaining<\/a> (archived link) in GitHub comments, but the new owners of Polyfill.io quickly removed all the criticisms (here\u2019s another <a href=\"https:\/\/web.archive.org\/web\/20240229113710\/https:\/github.com\/polyfillpolyfill\/polyfill-service\/issues\/2834\" target=\"_blank\" rel=\"nofollow noopener\">example<\/a> from the Internet Archive).<\/p>\n<p>The potentially harmful script is allegedly present on <a href=\"https:\/\/publicwww.com\/websites\/%22cdn.polyfill.io%22\/\" target=\"_blank\" rel=\"nofollow noopener\">more than 100,000 websites<\/a> \u2014 some of them rather big ones.<\/p>\n<h2>Google Ads: one more reason to remove Polyfill.io<\/h2>\n<p>\nIn case visitors getting a malicious script doesn\u2019t sound too worrying, Google Ads is giving website operators a further valid reason to hurry up and get the problem fixed.<\/p>\n<p>Google\u2019s advertising service has suspended the display of ads linking to websites that spread malicious scripts from several services. Besides Polyfill.io, the list includes Bootcss.com, Bootcdn.net and Staticfile.org.<\/p>\n<div id=\"attachment_51638\" style=\"width: 674px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05103010\/polyfill-io-service-supply-chain-attacks-3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-51638\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05103010\/polyfill-io-service-supply-chain-attacks-3.png\" alt=\" A Google Ads warning about malicious activity on a website\" width=\"664\" height=\"845\" class=\"size-full wp-image-51638\"><\/a><p id=\"caption-attachment-51638\" class=\"wp-caption-text\">A Google Ads suspension warning due to the website using a malicious script downloaded from Polyfill.io, Bootcss.com, Bootcdn.net or Staticfile.org. <a href=\"https:\/\/www.bleepingcomputer.com\/news\/security\/polyfillio-javascript-supply-chain-attack-impacts-over-100k-sites\/\" target=\"_blank\" rel=\"nofollow noopener\">Source<\/a><\/p><\/div>\n<p>You\u2019d be wise to stop using the aforementioned services on your website, or else you risk losing traffic due to users being led away by the malicious scripts and because of Google Ads no longer promoting you.<\/p>\n<h2>Protecting against the Polyfill.io attack<\/h2>\n<p>\nHere are a few steps to take about the attack:\n<\/p>\n<ul>\n<li>Remove the Polyfill.io script from your website as soon as you can\u00a0\u2014 along with ones from Bootcss.com, Bootcdn.net and Staticfile.org.<\/li>\n<li>Consider dropping polyfills altogether. The Polyfill.io developer, which recommends doing just that, says that polyfills are no longer relevant.<\/li>\n<\/ul>\n<div id=\"attachment_51637\" style=\"width: 1202px\" class=\"wp-caption aligncenter\"><a href=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05103022\/polyfill-io-service-supply-chain-attacks-4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-51637\" src=\"https:\/\/media.kasperskydaily.com\/wp-content\/uploads\/sites\/37\/2024\/07\/05103022\/polyfill-io-service-supply-chain-attacks-4.png\" alt=\"he Polyfill.io developer advises removing Polyfill.io\" width=\"1192\" height=\"1040\" class=\"size-full wp-image-51637\"><\/a><p id=\"caption-attachment-51637\" class=\"wp-caption-text\">The Polyfill.io developer recommends removing Polyfill.io and dropping polyfills altogether as these are no longer relevant. <a href=\"https:\/\/x.com\/triblondon\/status\/1761852117579427975\" target=\"_blank\" rel=\"nofollow noopener\">Source<\/a><\/p><\/div>\n<ul>\n<li>If you can\u2019t follow that advice for some reason, use the alternatives by <a href=\"https:\/\/cdnjs.cloudflare.com\/polyfill\/\" target=\"_blank\" rel=\"nofollow noopener\">Cloudflare<\/a> or <a href=\"https:\/\/community.fastly.com\/t\/new-options-for-polyfill-io-users\/2540\" target=\"_blank\" rel=\"nofollow noopener\">Fastly<\/a>.<\/li>\n<li>All in all, try cutting down on the number of external scripts your website uses. Each of those is a potential vulnerability.<\/li>\n<\/ul>\n<input type=\"hidden\" class=\"category_for_banner\" value=\"kesb-trial\">\n","protected":false},"excerpt":{"rendered":"<p>The JavaScript CDN service Polyfill.io has started spreading malicious code. Remove the service&#8217;s script from your website.<\/p>\n","protected":false},"author":2726,"featured_media":22991,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1318,1916,1917],"tags":[2088,1457,1072,1723,521,268,2772,399],"class_list":{"0":"post-22989","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-business","8":"category-enterprise","9":"category-smb","10":"tag-tips","11":"tag-business","12":"tag-development","13":"tag-supply-chain-attack","14":"tag-threats","15":"tag-vulnerabilities","16":"tag-web-apps","17":"tag-websites"},"hreflang":[{"hreflang":"en-ae","url":"https:\/\/me-en.kaspersky.com\/blog\/polyfill-io-service-supply-chain-attacks\/22989\/"},{"hreflang":"en-in","url":"https:\/\/www.kaspersky.co.in\/blog\/polyfill-io-service-supply-chain-attacks\/27672\/"},{"hreflang":"en-us","url":"https:\/\/usa.kaspersky.com\/blog\/polyfill-io-service-supply-chain-attacks\/30342\/"},{"hreflang":"en-gb","url":"https:\/\/www.kaspersky.co.uk\/blog\/polyfill-io-service-supply-chain-attacks\/27838\/"},{"hreflang":"ru","url":"https:\/\/www.kaspersky.ru\/blog\/polyfill-io-service-supply-chain-attacks\/37809\/"},{"hreflang":"x-default","url":"https:\/\/www.kaspersky.com\/blog\/polyfill-io-service-supply-chain-attacks\/51635\/"},{"hreflang":"ru-kz","url":"https:\/\/blog.kaspersky.kz\/polyfill-io-service-supply-chain-attacks\/27980\/"},{"hreflang":"en-au","url":"https:\/\/www.kaspersky.com.au\/blog\/polyfill-io-service-supply-chain-attacks\/33816\/"},{"hreflang":"en-za","url":"https:\/\/www.kaspersky.co.za\/blog\/polyfill-io-service-supply-chain-attacks\/33480\/"}],"acf":[],"banners":"","maintag":{"url":"https:\/\/me-en.kaspersky.com\/blog\/tag\/supply-chain-attack\/","name":"supply-chain attack"},"_links":{"self":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/22989","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/users\/2726"}],"replies":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/comments?post=22989"}],"version-history":[{"count":1,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/22989\/revisions"}],"predecessor-version":[{"id":22990,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/posts\/22989\/revisions\/22990"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/media\/22991"}],"wp:attachment":[{"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/media?parent=22989"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/categories?post=22989"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/me-en.kaspersky.com\/blog\/wp-json\/wp\/v2\/tags?post=22989"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}