Critical Malicious Code Vulnerability in pre-and-postinstall-scripts-example Package

Summary

22/07/2025
CRITICAL
No i
Critical
Not published

MAL-2025-6116: Malicious code in pre-and-postinstall-scripts-example (npm). Affects pre-and-postinstall-scripts-example versions >= 7.0.0. 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 Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

The pre-and-postinstall-scripts-example package is an npm package designed to demonstrate the use of pre-install and post-install scripts in Node.js applications. While it serves as a useful educational tool, it has been found to contain malicious code that communicates with a domain associated with harmful activities, posing a significant security risk to users and their systems.

Vulnerability Detail

The vulnerability originates from the package's embedded malicious code, which can compromise any computer that has this package installed or running. This malicious code can lead to unauthorized access to sensitive information, including secrets and keys stored on the affected computer. The presence of this code indicates that the system may be fully compromised, necessitating immediate action to mitigate potential damage.

How To Fix

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

npm uninstall pre-and-postinstall-scripts-example

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 workaround, users can temporarily disable the execution of scripts during installation by using the following command: 'npm install --ignore-scripts'. However, this does not eliminate the risk associated with the malicious package and should only be considered a short-term measure.

Conclusion

The pre-and-postinstall-scripts-example package contains a critical vulnerability due to embedded malicious code. Users must take immediate action to remove the package and secure their systems. Regular monitoring for vulnerabilities using tools like Vulert is essential to maintain software security.

See every vulnerability recorded for pre-and-postinstall-scripts-example →

Share this vulnerability

FAQ

The malicious code in the pre-and-postinstall-scripts-example package communicates with a domain linked to malicious activities, potentially compromising user data.

If you have installed the pre-and-postinstall-scripts-example package, your system may be affected. You can use Vulert to monitor and alert for open-source vulnerabilities in your software.

If you suspect a compromise, immediately remove the package, rotate all sensitive keys and secrets, and consider performing a full security audit of your system.

Yes, you can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without requiring any installation or signup.

Long-term implications include potential data breaches, unauthorized access to sensitive information, and the risk of further malware installation on the compromised system.

How To Fix

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

npm uninstall pre-and-postinstall-scripts-example

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