Malicious Code Injection in express-nodejs Package: A Critical Vulnerability
Summary
MAL-2026-17243: Malicious code in express-nodejs (npm). Affects express-nodejs versions 5.2.1. 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 express-nodejs package, version 5.2.1, is a typosquatted version of the popular Express framework, which is widely used for building web applications in Node.js. This package mimics the original Express framework by copying its description, author details, repository, and homepage. However, it poses a significant security risk due to its malicious preinstall script that executes arbitrary code during installation.
Vulnerability Detail
The vulnerability originates from the express-nodejs package, which includes a preinstall lifecycle hook that runs a command to fetch and execute a script from an external source (Codeberg). This script is fetched through web.archive.org, allowing the attacker to execute arbitrary code on the installer's machine without any integrity checks or relationship to the original express project. This can lead to severe security breaches, including data theft, unauthorized access, or system compromise.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall express-nodejs
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 express-nodejs package altogether and directly use the official Express framework. If you have already installed express-nodejs, uninstall it using: npm uninstall express-nodejs.
Conclusion
The express-nodejs package version 5.2.1 contains a critical vulnerability that allows for the execution of arbitrary code during installation. Users are strongly advised to uninstall this package and switch to the legitimate Express framework to ensure the security of their applications. Utilizing tools like Vulert can help monitor and alert for such vulnerabilities in real-time.
See every vulnerability recorded for express-nodejs →
FAQ
Typosquatting is a malicious practice where attackers create fake packages that mimic legitimate ones, often with slight variations in the name, to deceive users into installing them.
You can use Vulert, which monitors and alerts for open-source vulnerabilities in your software. By checking your package-lock.json file, you can identify if your application is affected by this vulnerability.
Installing malicious packages can lead to arbitrary code execution, data breaches, unauthorized access to systems, and potential compromise of sensitive information.
To prevent typosquatting attacks, always verify package names before installation, use trusted sources, and regularly audit your dependencies for vulnerabilities.
Yes, you can report malicious packages to the maintainers of the package registry (like npm) or security organizations that track vulnerabilities.