Malicious Code Detected in Chain-Selectors Package: Version 2.0.0
Summary
MAL-2025-191487: Malicious code in chain-selectors (npm). Affects chain-selectors versions 2.0.0 – 4.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
Chain-selectors is an npm package designed to facilitate the selection of elements in a chain-like manner, often used in web development for manipulating the Document Object Model (DOM). The package is intended to simplify the process of selecting and interacting with multiple elements in a web application. However, version 2.0.0 has been identified as malicious, posing significant security risks to applications that utilize it.
Vulnerability Detail
The vulnerability in the chain-selectors package arises from its malicious behavior, which includes communication with a domain linked to harmful activities and the execution of commands that can compromise system integrity. This behavior can lead to unauthorized access, data breaches, and potential exploitation of the affected systems. The malicious nature of this package was identified by the OpenSSF Package Analysis project, which flagged it for its harmful actions.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chain-selectors
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 measure, you can remove the chain-selectors package from your project until a safe version is confirmed. To do this, run the following command: npm uninstall chain-selectors. Additionally, consider using alternative packages that provide similar functionality without the associated risks.
Conclusion
The chain-selectors package version 2.0.0 has been flagged as malicious due to its harmful behavior, including communication with malicious domains and executing dangerous commands. Users are advised to update to version 4.0.0 or later to mitigate risks. For ongoing monitoring, tools like Vulert can help identify vulnerabilities in your applications.
See every vulnerability recorded for chain-selectors →
FAQ
Chain-selectors is an npm package used for selecting and manipulating DOM elements in a web application.
The malicious behavior was identified by the OpenSSF Package Analysis project, which monitors and analyzes packages for security vulnerabilities.
Using the compromised version can lead to unauthorized access, data breaches, and exploitation of your application, potentially compromising user data and system integrity.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. You can check your application by visiting the Vulert playground at Vulert Scanner without needing to sign up.
If immediate updates are not possible, consider removing the package and using alternative solutions until a safe version is available.