Critical Malware Installation Vulnerability in napi-postinstall Package

napi-postinstall Updated 02 Oct 2025

Summary

21/07/2025
CRITICAL
No i
Critical
Not published

MAL-2025-6025: Malicious code in napi-postinstall (npm). Affects napi-postinstall versions 0.3.1. No fix is published. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

Background

The napi-postinstall package is an npm module designed to facilitate post-installation scripts for Node.js applications. It is commonly used to automate tasks that need to occur after a package is installed, such as compiling native add-ons. However, this package has been identified as having a severe vulnerability that allows malicious code to be executed during its installation process.

Vulnerability Detail

This vulnerability arises from the inclusion of a malicious file, node-gyp.dll, which is installed via the install.js script of the napi-postinstall package. This file is a Windows-based malware that can compromise the security of the system where the package is installed. The ramifications of this vulnerability include unauthorized access to sensitive data, system instability, and potential exploitation by attackers. The technical aspect of this vulnerability lies in the fact that the malicious code is executed without user consent during the installation phase, making it particularly dangerous.

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall napi-postinstall

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 napi-postinstall package until a secure version is released. Alternatively, you can manually check your package-lock.json file for any instances of napi-postinstall and remove it from your dependencies.

Conclusion

The napi-postinstall package has a critical vulnerability that allows the installation of malicious software during its setup process. It is vital for developers to take immediate action by updating their dependencies and monitoring for any updates regarding this issue. Utilizing tools like Vulert can help maintain the security of your applications.

See every vulnerability recorded for napi-postinstall →

Share this vulnerability

FAQ

The vulnerability involves the installation of a malicious Windows-based file, node-gyp.dll, during the package's installation process.

You can use Vulert, which monitors and alerts for open-source vulnerabilities in real-time. Visit Vulert Scanner to check if your application is affected without needing to sign up.

The consequences include unauthorized access to sensitive data, system instability, and exploitation by attackers.

Currently, there is no specific patch mentioned, but it is essential to keep an eye on updates for the napi-postinstall package.

As a temporary measure, consider removing the package from your dependencies or using an alternative package until a secure version is released.

Sponsored Lume, the Habilume companion Habilume Habit tracker with a companion that grows with you Complete habits, earn Lume Points, and watch your Lume grow as you stay consistent. App Store Google Play

How To Fix

This package is malicious. Remove it and rotate any credentials it could have accessed.

npm uninstall napi-postinstall

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 →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback