Regular Expression Denial of Service in esm

esm Updated 02 Oct 2025

Summary

20/06/2019
MODERATE
Yes i
Moderate
Not published

GHSA-qx4v-6gc5-f2vv: Regular Expression Denial of Service. Affects esm versions < 3.1.0. Fixed in 3.1.0. 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 MarkAI Find prospects already talking about the problem you solve AI watches the communities your customers use to find qualified prospects, then alerts you when a conversation is worth joining. See MarkAI

Background

The esm package is an npm package that provides ECMAScript module loader implementation. It allows developers to use ES modules in Node.js. The package is widely used in JavaScript projects to enable the use of modern JavaScript syntax and features. However, a vulnerability has been discovered in esm before version 3.1.0.

Vulnerability Detail

The vulnerability in esm is a Regular Expression Denial of Service (ReDoS) issue. The find-indexes function in esm uses unescaped identifiers in a regular expression, which can lead to an infinite loop. An attacker can exploit this vulnerability by providing specially crafted input that triggers the infinite loop, causing a denial of service condition. This can result in resource exhaustion and impact the availability of the affected application.

How To Fix

Minimum fixed version

3.1.0

This is the first release that contains the fix.

npm install esm@3.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is recommended to update the esm package to the fixed version.

Conclusion

The esm package before version 3.1.0 is vulnerable to a Regular Expression Denial of Service (ReDoS) issue. It is recommended to update the package to the fixed version to mitigate the vulnerability. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for esm →

Share this vulnerability

FAQ

esm is an npm package that provides ECMAScript module loader implementation for Node.js.

A Regular Expression Denial of Service (ReDoS) vulnerability occurs when a regular expression pattern can be exploited to cause a denial of service condition by triggering an infinite loop.

An attacker can exploit this vulnerability by providing specially crafted input that triggers the infinite loop in the esm package, causing a denial of service condition.

The vulnerability can lead to resource exhaustion and impact the availability of the affected application.

To fix this vulnerability, update the esm package to version 3.1.0 or later.

How To Fix

Minimum fixed version

3.1.0

This is the first release that contains the fix.

npm install esm@3.1.0

Tip — Not sure which version your app runs? Vulert can match this fix to it. 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