Malicious Code Injection in ahnafnaseem Package: Exploiting npm for Token Rewards
Summary
MAL-2025-170715: Malicious code in ahnafnaseem (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 ahnafnaseem package is part of the npm ecosystem, which is widely used for JavaScript package management. It is often leveraged by developers to share and manage code dependencies. However, this package has been identified as part of a malicious campaign that aims to exploit the npm registry by flooding it with derivative packages that inflate developer reputation scores for token rewards. The presence of such malicious packages poses a significant risk to developers and users relying on npm for secure software development.
Vulnerability Detail
The vulnerability in the ahnafnaseem package originates from its association with a campaign that generates and publishes numerous derivative packages with randomized names. These packages contain scripts that modify the package.json file to remove private flags, alter version numbers, and continuously republish variants, leading to pollution of the npm registry. This malicious behavior can compromise the integrity of the npm ecosystem, potentially allowing attackers to execute arbitrary code or manipulate dependencies in unsuspecting applications.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall ahnafnaseem
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 the ahnafnaseem package and any other packages that may have been published as part of this malicious campaign. Regularly audit your package.json and package-lock.json files to identify and remove any suspicious or untrusted packages.
Conclusion
The ahnafnaseem package poses a significant security risk due to its malicious behavior aimed at exploiting the npm registry. It is essential for developers to remain vigilant, regularly audit their dependencies, and utilize tools like Vulert to monitor for vulnerabilities. By taking proactive measures, you can safeguard your applications from potential threats.
See every vulnerability recorded for ahnafnaseem →
FAQ
The ahnafnaseem package is an npm package that has been identified as part of a malicious campaign to exploit the npm registry.
This vulnerability can lead to the injection of malicious code into your application, compromising its security and integrity.
You should immediately uninstall the ahnafnaseem package using the command npm uninstall ahnafnaseem and audit your dependencies.
You can use tools like Vulert, which monitors your package-lock.json file for open-source 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 any signup.