Critical Malicious Code Vulnerability in css-env-function-shim Package
Summary
MAL-2026-17477: Malicious code in css-env-function-shim (npm). Affects css-env-function-shim 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-env-function-shim package is designed to provide a shim for the CSS env() function, enabling developers to use environment variables in their styles. However, this package has been found to contain malicious code that compromises the security of applications using it. The vulnerability arises from the inclusion of a script that executes harmful commands and exfiltrates sensitive information.
Vulnerability Detail
The vulnerability originates from the malicious code embedded in the thunderboltRegistry.js file, which is executed upon module load. This code base64-decodes sensitive strings, dynamically requires the child_process module, and executes several system commands such as whoami, uname, and others to gather sensitive information. The collected data is then sent to a hardcoded external URL, posing a significant risk of data leakage and system compromise. The malicious behavior is designed to evade detection by storing sensitive identifiers as base64 blobs and reconstructing them at runtime.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall css-env-function-shim
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, you can remove the css-env-function-shim package from your project until a secure version is released. You can do this by running: npm uninstall css-env-function-shim. Additionally, consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The css-env-function-shim package contains a critical vulnerability that allows malicious code execution, posing serious risks to applications. It is essential to update or remove the package to safeguard your system. Monitoring tools like Vulert can help you stay informed about vulnerabilities in your dependencies.
See every vulnerability recorded for css-env-function-shim →
FAQ
css-env-function-shim is a package that allows developers to use the CSS env() function in their applications, providing a way to access environment variables in styles.
The vulnerability allows malicious code to execute commands on your system, potentially leading to data leakage and unauthorized access to sensitive information.
You should immediately update the css-env-function-shim package to a patched version or remove it from your project until a secure version is available.
You can use Vulert, which monitors and alerts you in real-time for open-source vulnerabilities in your software by analyzing your package-lock.json file.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.