Malicious Code Injection in 4four Package: npm Vulnerability Overview
Summary
MAL-2025-170602: Malicious code in 4four (npm). Affected versions are not published. 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 4four package is part of the npm ecosystem, which is widely used for JavaScript package management. It is often utilized in various applications to enhance functionality and streamline development processes. However, this package has been identified as part of a malicious campaign that targets developers by flooding the npm registry with harmful scripts designed to manipulate package metadata and inflate reputation scores.
Vulnerability Detail
The vulnerability in the 4four package stems from its association with the tea.xyz token reward campaign, which has been linked to the distribution of malicious code. This code modifies the package.json file by removing private flags, altering version numbers, and generating random package names. The malicious payload continuously republishes these variants, leading to pollution of the npm registry and potential exploitation of developers who unknowingly use these compromised packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall 4four
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 4four package from your project by executing the command: 'npm uninstall 4four'. This will prevent any malicious code from executing until a secure version is available.
Conclusion
The 4four package has been identified as a vector for malicious code that can compromise npm projects. It is crucial for developers to stay informed about vulnerabilities and take proactive measures to secure their applications. Regular updates and monitoring tools like Vulert can significantly enhance your security posture.
See every vulnerability recorded for 4four →
FAQ
The 4four package is an npm package used in JavaScript development, but it has been compromised with malicious code.
The malicious code modifies your package.json file and can lead to the publication of harmful variants, potentially compromising your application.
You should uninstall the package immediately and check for any updates or patches that may address the vulnerability.
You can use tools like Vulert, which monitors your package-lock.json file for vulnerabilities in real-time without requiring code access.
Yes, you can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without signing up.