Critical Malicious Code Vulnerability in connect-mayfly Package
Summary
MAL-2025-17494: Malicious code in connect-mayfly (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 connect-mayfly package is a middleware for Node.js applications, designed to facilitate the connection between various components of web applications. It is commonly used in the npm ecosystem for its simplicity and effectiveness in managing HTTP requests. However, recent findings have revealed that this package contains malicious code, posing significant security risks to applications that utilize it.
Vulnerability Detail
The vulnerability in the connect-mayfly package originates from the inclusion of malicious code that can compromise the security of applications using this package. This code may allow unauthorized access to sensitive data, lead to data breaches, or enable remote code execution. The issue affects all versions of the package starting from its introduction, making it critical for users to take immediate action to mitigate potential risks.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall connect-mayfly
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, users can remove the connect-mayfly package from their project until a secure version is released. This can be done using the command: 'npm uninstall connect-mayfly'. Alternatively, consider using a different middleware package that does not have known vulnerabilities.
Conclusion
The discovery of malicious code in the connect-mayfly package poses a serious threat to applications using it. Immediate action is required to update or remove the package to safeguard against potential security breaches. Utilizing tools like Vulert can help monitor for such vulnerabilities in real-time.
See every vulnerability recorded for connect-mayfly →
FAQ
Connect-mayfly is a middleware for Node.js applications that helps manage HTTP requests and responses.
The malicious code can potentially allow unauthorized access to sensitive data and may lead to data breaches.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check your application without needing to sign up.
Users should check the package repository for any available patched versions and update accordingly.
As a temporary measure, consider uninstalling the connect-mayfly package or using an alternative middleware until a secure version is available.