flawopen.com/Teardowns/polyfill-io-supply-chain-hijack
vulnerabilidade का गहन तकनीकी स्रोत कोड विश्लेषण और सुरक्षा सुदृढ़ीकरण गाइड: भेद्यता के मूल कारण और सुरक्षित पैच की समीक्षा।
कल्पना कीजिए कि हज़ारों रेस्तरां वर्षों से एक ही भरोसेमंद जल वितरण कूरियर सेवा ले रहे हैं। जब पुराना कूरियर सेवानिवृत्त हुआ और उसने गुप्त रूप से व्यवसाय एक धोखेबाज को बेच दिया, तो नए डिलीवरी ड्राइवर ने मेजों की जाँच शुरू कर दी और चुनिंदा ग्राहकों के पेय में नकली लॉटरी टिकट डालना शुरू कर दिया।
Dynamic User-Agent PolyfillingConditional Payload EvasionDomain Ownership Transfer RiskSubresource Integrity (SRI)मूल कारण ओपन सोर्स सिस्टम में अनसत्यापित सीमा पैरामीटर हैं, जिससे स्थिति का असंतुलन और सुरक्षा नियंत्रणों को बायपास किया जा सकता है।
In February 2024, the domain polyfill.io was purchased from its creator by Funnull, an operator associated with casino affiliate marketing.
The CDN edge inspected incoming HTTP requests. If the request was from an admin IP, Google bot, or desktop browser with DevTools open, it served normal, benign polyfills.
If the request was from an organic mobile visitor via search referrer, the server appended an obfuscated redirect payload: window.location.href = 'https://kucontent.com/...'.
Cloudflare and Fastly deployed automatic edge URL rewrites to replace polyfill.io with clean mirrors, while Google flagged all sites utilizing the script in search results.
<!-- VULNERABLE: Direct 3rd-party CDN script without integrity verification -->
<!DOCTYPE html>
<html>
<head>
<title>Production Web App</title>
<!-- Polyfill CDN serves arbitrary dynamic code controlled by third party -->
<script src="https://cdn.polyfill.io/v3/polyfill.min.js?features=default,Array.prototype.flat"></script>
</head>
<body>
<h1>Welcome</h1>
</body>
</html>
<!-- SECURE: Native ES6+ or Self-Hosted Vendored Fallbacks with CSP & SRI -->
<!DOCTYPE html>
<html>
<head>
<title>Production Web App</title>
<!-- 1. Modern browsers require no polyfills (99%+ modern baseline) -->
<!-- 2. For legacy needs, bundle polyfills locally into your build pipeline -->
<script src="/static/vendor/core-js-bundle.min.js"
integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
crossorigin="anonymous"></script>
<!-- 3. Strict Content Security Policy blocking untrusted third-party script sources -->
<meta http-equiv="Content-Security-Policy"
content="default-src 'self'; script-src 'self' 'sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC';">
</head>
<body>
<h1>Welcome</h1>
</body>
</html>