Malicious Code Injection in chalk-figlet Package
Summary
MAL-2026-17223: Malicious code in chalk-figlet (npm). Affects chalk-figlet versions 1.2.0. 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 chalk-figlet package is a Node.js library that combines the functionality of chalk (for styling terminal output) with figlet (for creating ASCII art text). It is commonly used in command-line applications to enhance user interfaces. However, this package has been found to contain malicious code that poses significant security risks.
Vulnerability Detail
The vulnerability originates from a postinstall script declared in the package.json file, which executes a malicious script during the installation process. This script downloads a binary from a hex-obfuscated URL and executes it, masquerading as a legitimate Windows system file. The implications of this vulnerability include unauthorized access to the system, potential data breaches, and the installation of malware.
How To Fix
This package is malicious. Remove it and rotate any credentials it could have accessed.
npm uninstall chalk-figlet
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 chalk-figlet package until it has been updated. Additionally, you can manually remove the package from your project by running: npm uninstall chalk-figlet.
Conclusion
The chalk-figlet package has been identified as containing malicious code that can compromise system security. It is crucial for developers to update to the latest version or remove the package to mitigate risks associated with this vulnerability.
See every vulnerability recorded for chalk-figlet →
FAQ
The malicious code downloads and executes a binary file from an obfuscated URL, posing as a legitimate system file.
You can use Vulert to monitor and alert for open-source vulnerabilities in your software. Visit Vulert Scanner to check your application without needing to sign up.
The risks include unauthorized access to your system, potential data breaches, and the installation of harmful software.
Yes, updating the chalk-figlet package to the latest version will address the vulnerability.
As a temporary measure, you should uninstall the chalk-figlet package and refrain from using it until a secure version is available.