Malicious Code Detected in hops-preset-jest: A Critical Vulnerability
Summary
MAL-2026-908: Malicious code in hops-preset-jest (npm). Affects hops-preset-jest 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
hops-preset-jest is an npm package designed to provide preset configurations for Jest, a popular JavaScript testing framework. It simplifies the setup process for developers by bundling commonly used configurations and plugins. However, the version 1.0.0 of this package has been flagged for malicious activity, raising concerns about its integrity and security.
Vulnerability Detail
The vulnerability in hops-preset-jest arises from its communication with a domain associated with malicious activities. This behavior poses significant risks, including potential data breaches, unauthorized access to sensitive information, and the possibility of further exploitation within the software environment. The origin of this vulnerability has been traced back to the package's design, which allows it to connect to external domains without adequate security checks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall hops-preset-jest
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 avoid using hops-preset-jest altogether and manually configure Jest according to your project's requirements. This can be done by creating a jest.config.js file in your project root and specifying the necessary configurations directly.
Conclusion
The discovery of malicious code in hops-preset-jest highlights the importance of scrutinizing third-party packages for security vulnerabilities. Developers should take immediate action to remove the affected package and consider alternative solutions to ensure the integrity of their applications.
See every vulnerability recorded for hops-preset-jest →
FAQ
hops-preset-jest is an npm package that provides preset configurations for the Jest testing framework, aimed at simplifying the testing setup for developers.
A malicious package is one that contains harmful code or behavior, such as unauthorized data transmission, which can compromise the security of applications using it.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. By utilizing the Vulert playground, you can check if your application is affected without any signup.
If you have installed hops-preset-jest, it is advisable to uninstall it immediately and consider using alternative packages or manually configuring Jest.
While there may not be direct alternatives, you can configure Jest manually or look for other preset packages that are well-reviewed and maintained.