Critical Malicious Code Vulnerability in tfjs-backend-nodegl Package
Summary
MAL-2025-6202: Malicious code in tfjs-backend-nodegl (npm). Affects tfjs-backend-nodegl versions 0.0.1 – 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 tfjs-backend-nodegl package is a Node.js backend for TensorFlow.js, designed to enable efficient execution of machine learning models in a Node environment. It provides a backend for WebGL, allowing developers to leverage GPU acceleration for their applications. However, this package has been identified to contain malicious code that compromises the security of any system it is installed on.
Vulnerability Detail
The vulnerability stems from the presence of embedded malicious code within the tfjs-backend-nodegl package. This code can lead to complete system compromise, allowing unauthorized access to sensitive information such as secrets and keys stored on the affected machine. The malicious nature of this code is classified under CWE-506, indicating that it appears to be intentionally harmful. Systems running this package should be considered fully compromised, and immediate action is required to mitigate potential damage.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall tfjs-backend-nodegl
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 workaround, you can temporarily disable the use of the tfjs-backend-nodegl package in your application until it is confirmed safe. This can be done by commenting out the relevant import statements in your code, for example:
// const tfjsBackendNodegl = require('tfjs-backend-nodegl');
Conclusion
The tfjs-backend-nodegl package has been identified as containing malicious code that poses a significant security risk. Immediate removal of the package and rotation of sensitive information is essential to protect your system. Utilize tools like Vulert to monitor for vulnerabilities in your applications.
See every vulnerability recorded for tfjs-backend-nodegl →
FAQ
Immediately remove the package from your system and rotate any sensitive information stored on the affected machine.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.
Currently, there is no patched version available for the tfjs-backend-nodegl package. The best course of action is to remove it entirely.
Failing to address this vulnerability can lead to unauthorized access to your system, data breaches, and potential exploitation of sensitive information.
Yes, you can continue using other TensorFlow.js packages, but ensure they are not dependent on the compromised tfjs-backend-nodegl package.