Critical Malicious Code Vulnerability in terser-js Package

terser-js Updated 12 Jan 2026

Summary

12/01/2026
CRITICAL
No i
Critical
Not published

MAL-2026-206: Malicious code in terser-js (npm). Affected versions are not published. 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 Penetration testing for web, API and mobile Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

terser-js is a popular JavaScript parser, mangler, and compressor toolkit used in web development to optimize JavaScript code for production. It is widely adopted due to its efficiency and ability to reduce file sizes, enhancing load times and performance. However, recent findings have revealed that the package has been compromised, leading to severe security risks for users who have it installed.

Vulnerability Detail

The vulnerability in terser-js is classified as malicious code embedded within the package. This issue originated from a compromised version of the package, which allows unauthorized access to any computer running it. The ramifications are significant, as it can lead to full control of the affected system, potentially exposing sensitive information such as secrets and keys. Users are advised to treat any system with this package installed as fully compromised.

How To Fix

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

npm uninstall terser-js

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, it is recommended to rotate all secrets and keys stored on the affected computer from a different, secure machine. Additionally, consider using alternative packages that provide similar functionality without the associated risks.

Conclusion

The discovery of malicious code in the terser-js package poses a significant threat to users. Immediate action is required to remove the package and secure any sensitive information. Users are encouraged to monitor their systems and consider alternative solutions until a secure version is released.

See every vulnerability recorded for terser-js →

Share this vulnerability

FAQ

The malicious code allows unauthorized access to the system, potentially compromising sensitive data.

You can use Vulert's playground at Vulert Scanner to check if your application is affected without any signup.

Immediately rotate all secrets and keys from a secure machine to prevent unauthorized access.

Currently, there is no patch available, and the recommendation is to remove the package entirely.

Failure to address this vulnerability can lead to unauthorized access, data breaches, and potential control over your system by malicious actors.

How To Fix

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

npm uninstall terser-js

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