Prototype Pollution Vulnerability in UglifyJS: CVE-2022-37598

uglify-js Updated 02 Oct 2025

Summary

20/10/2022
N/A
No i
Unrated
Not published

DEBIAN-CVE-2022-37598: Prototype pollution vulnerability in function DEFNODE in ast.js in mishoo UglifyJS 3.13.2 via the name variable in ast.js. Affects uglify-js versions 3.12.8-1 – 3.17.4-2. 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

UglifyJS is a widely-used JavaScript parser, minifier, and compressor that helps developers optimize their JavaScript code for better performance. It is known for its ability to reduce file sizes and improve load times by removing unnecessary characters and whitespace. However, a vulnerability has been identified in versions of UglifyJS, specifically affecting the DEFNODE function in ast.js, which could lead to prototype pollution, potentially compromising application security.

Vulnerability Detail

The vulnerability, identified as CVE-2022-37598, originates from a flaw in the DEFNODE function within the ast.js file of UglifyJS version 3.13.2. This flaw allows an attacker to manipulate the 'name' variable, leading to prototype pollution. The ramifications of this vulnerability can be severe, as it may allow attackers to alter the behavior of the application by injecting properties into the Object prototype, which can lead to unexpected behavior or security breaches.

How To Fix

No fixed version is published for this vulnerability.

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 vulnerable features of UglifyJS until you can update to a patched version. Additionally, consider using alternative minification tools that do not have this vulnerability.

Conclusion

The prototype pollution vulnerability in UglifyJS (CVE-2022-37598) poses significant risks to applications using this library. It is crucial for developers to update to the latest version to mitigate these risks and ensure the security of their applications.

See every vulnerability recorded for uglify-js →

Share this vulnerability

FAQ

CVE-2022-37598 is a prototype pollution vulnerability found in UglifyJS that allows attackers to manipulate the Object prototype through the DEFNODE function in ast.js.

You can use the Vulert playground at Vulert Scanner to check if your application is affected by this vulnerability without needing to sign up.

The potential impacts include unauthorized modification of application behavior, which could lead to security breaches or data corruption.

Yes, updating to the latest version of UglifyJS will provide a patch for this vulnerability.

If you cannot update immediately, consider using alternative minification tools and avoid using the vulnerable features of UglifyJS.

Related vulnerabilities

Recent vulnerabilities recorded for uglify-js.

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

No fixed version is published for this vulnerability.

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