Malicious Code Injection in css-scroll-anchor-polyfill Package
Summary
MAL-2026-17485: Malicious code in css-scroll-anchor-polyfill (npm). Affects css-scroll-anchor-polyfill versions 1.0.0. No fix is published. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The css-scroll-anchor-polyfill is an npm package designed to provide a polyfill for CSS scroll anchors. It aims to enhance web applications by ensuring consistent scrolling behavior across different browsers. However, this package has been compromised, leading to significant security concerns due to the presence of malicious code that impersonates internal module names.
Vulnerability Detail
The vulnerability originates from a malicious code injection within the css-scroll-anchor-polyfill package. The package's index.js file is empty, but it contains a script (thunderboltRegistry.js) that executes local reconnaissance commands using child_process.execSync. It collects sensitive information such as the contents of /etc/hosts, the current user, and network configurations. This data is then sent to a hardcoded HTTP endpoint, allowing attackers to exfiltrate sensitive information from affected systems. The declared purpose of the package is unrelated to the actual shipped code, posing a severe risk to any application that inadvertently requires this package.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall css-scroll-anchor-polyfill
If it arrived as a transitive dependency, remove the package that pulled it in, then reinstall.
Tip — Not sure whether your app is affected? Vulert can check the versions your app actually runs. Scan free →
Workaround
As a temporary workaround, avoid using the css-scroll-anchor-polyfill package in your project. If it is a dependency of another package, consider removing that package or replacing it with a secure alternative until the vulnerability is addressed.
Conclusion
The css-scroll-anchor-polyfill package has been compromised with malicious code that can lead to significant security risks. It is essential to remove this package from your projects and monitor for any updates. Utilizing tools like Vulert can help you stay informed about vulnerabilities in your dependencies.
See every vulnerability recorded for css-scroll-anchor-polyfill →
FAQ
It is an npm package intended to provide a polyfill for CSS scroll anchors, enhancing scrolling behavior in web applications.
The malicious code can execute local commands to gather sensitive information from your system and send it to an external server, compromising your application's security.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without requiring any signup.
Immediately remove the css-scroll-anchor-polyfill package from your project and monitor for any updates or patches from the package maintainers.
Yes, consider using other libraries or polyfills that provide similar functionality without the associated risks. Always ensure to review the security of any package before use.