Malicious Code Injection in afdalrahim Package: npm Vulnerability Overview
Summary
MAL-2025-170680: Malicious code in afdalrahim (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 afdalrahim package is part of the npm ecosystem, primarily used for JavaScript development. It is associated with the tea.xyz token reward campaign, which has been known to flood the npm registry with numerous packages. These packages often contain scripts designed to manipulate package metadata and inflate developer reputation scores, making them a target for malicious activity.
Vulnerability Detail
The afdalrahim package contains malicious code that modifies the package.json file by removing private flags, altering version numbers, and generating random package names. This behavior is part of a broader scheme to publish derivative packages that pollute the npm registry, potentially leading to security risks for developers who unknowingly use these compromised packages. The vulnerability originates from the package's association with the tea.xyz token reward campaign, which employs autopublish scripts to automate the creation and publication of these malicious packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall afdalrahim
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 avoid using the afdalrahim package and remove it from your project dependencies. To do this, run: npm uninstall afdalrahim.
Conclusion
The afdalrahim package presents a significant security risk due to its malicious code that alters package metadata and publishes unwanted variants. It is essential for developers to be vigilant, update their dependencies, and utilize tools like Vulert to monitor for vulnerabilities in their projects.
See every vulnerability recorded for afdalrahim →
FAQ
The afdalrahim package is an npm package that has been linked to malicious activities, specifically designed to manipulate package metadata and inflate developer reputation scores.
The vulnerability can lead to the introduction of malicious code into your project, potentially compromising security and stability by polluting the npm registry with unwanted packages.
If you have installed the afdalrahim package, it is crucial to uninstall it immediately and check your project for any unintended consequences.
Yes, you can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just your package-lock.json file. You can check if your application is affected by this vulnerability using the Vulert playground without any signup.
Regularly update your dependencies, monitor them for vulnerabilities using tools like Vulert, and review the security advisories for the packages you use.