Malicious Code Vulnerability in ahnafyasin Package
Summary
MAL-2025-170721: Malicious code in ahnafyasin (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 ahnafyasin package is part of the npm ecosystem, which is widely used for JavaScript package management. This package has been identified as part of a malicious campaign that aims to exploit the npm registry by flooding it with derivative packages. These packages are designed to inflate developer reputation scores for token rewards, making them a significant concern for developers relying on npm for secure package management.
Vulnerability Detail
The vulnerability in the ahnafyasin package originates from its involvement in a token reward campaign that utilizes autopublish scripts to generate and publish numerous derivative packages with randomized names. This malicious behavior modifies the package.json file by removing private flags, changing version numbers, and continuously republishing variants, which can lead to pollution of the npm registry and potential security risks for developers who inadvertently use these packages.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall ahnafyasin
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 ahnafyasin package and any packages that depend on it. Additionally, consider using tools like Vulert to monitor your project for vulnerabilities. You can check if your application is affected by this vulnerability using the Vulert playground at https://vulert.com/scanner without any signup.
Conclusion
The ahnafyasin package poses a significant security risk due to its malicious code designed to exploit the npm registry. Developers should take immediate action to remove this package and monitor their projects for vulnerabilities to ensure the integrity of their applications.
See every vulnerability recorded for ahnafyasin →
FAQ
The ahnafyasin 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 pollution of the npm registry and may introduce security risks if your project inadvertently uses affected packages.
You should remove the ahnafyasin package from your project and check for any dependencies that may rely on it.
Yes, you can use Vulert, which monitors and alerts in real-time for open-source vulnerabilities using just package-lock.json.
You can check your application for vulnerabilities using the Vulert playground at Vulert Scanner without any signup.