Critical Malicious Code Vulnerability in @trigo/bool-expressions Package
Summary
MAL-2025-190683: Malicious code in @trigo/bool-expressions (npm). Affects @trigo/bool-expressions versions 4.1.3. 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 @trigo/bool-expressions package is an npm library designed for evaluating boolean expressions in JavaScript applications. It provides developers with a simple way to parse and evaluate logical statements. However, this package has been identified as containing malicious code, posing significant security risks to any system that utilizes it.
Vulnerability Detail
The vulnerability originates from the inclusion of malicious code within the @trigo/bool-expressions package, specifically version 4.1.3. This code can compromise the entire system where the package is installed, allowing unauthorized access to sensitive data such as secrets and keys. The malicious nature of the code falls under CWE-506, indicating that it embeds harmful functionalities that can lead to severe security breaches.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall @trigo/bool-expressions
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
There are no effective workarounds for this vulnerability other than removing the package entirely. It is advisable to replace the functionality provided by @trigo/bool-expressions with a trusted alternative library that does not contain malicious code.
Conclusion
The @trigo/bool-expressions package has been identified as containing malicious code that poses a significant security risk. Immediate action is required to remove the package and secure any sensitive information. Regular monitoring and using trusted libraries can help prevent similar vulnerabilities in the future.
See every vulnerability recorded for @trigo/bool-expressions →
FAQ
You should uninstall the package immediately and rotate any sensitive information that may have been compromised.
You can use Vulert, which monitors and alerts for open-source vulnerabilities. By uploading your package-lock.json file, you can check for vulnerabilities without needing to install any software.
Regularly monitor your dependencies using tools like Vulert and keep your packages updated to minimize the risk of vulnerabilities.
The malicious code can lead to unauthorized access to sensitive data and potentially give attackers control over your system.
Yes, consider using well-reviewed and actively maintained libraries for evaluating boolean expressions that do not have known vulnerabilities.