# CVE-2021-23392: locutus Regular Expression Denial of Service in gopher_parsedir

Source: https://junglewise.ai/threats/cve-2021-23392-locutus-regular-expression-denial-of-service-in-gopher-parsedir  
Publisher: Junglewise Threat Intelligence, https://junglewise.ai/threats  
Published: 2021-06-10. Updated: 2026-05-14  
License: CC BY 4.0 with a link back

CVE-2021-23392 · Severity: low · CVSS 3.1 · Published 2021-06-10

Locutus is a library that provides JavaScript implementations of standard functions from other programming languages. A vulnerability in its Gopher protocol parsing function allows an attacker to send specially crafted data that causes the system to freeze or become unresponsive. This can lead to a service outage, preventing legitimate users from accessing the application.

Technologies: [locutus (npm)](https://junglewise.ai/threats/technologies/locutus). Vendors: [npm](https://junglewise.ai/threats/vendors/npm).

## Quick answers

**Is CVE-2021-23392 exploited in the wild?** No. Junglewise Threat Intelligence has no report of CVE-2021-23392 being exploited in the wild.

**How severe is CVE-2021-23392?** Low severity, with a CVSS score of 3.1, published 10 June 2021.

**Which products and versions are affected?** locutus (npm) SEMVER:introduced=0,fixed=2.0.15.

**Is there a fix for CVE-2021-23392?** Yes. locutus (npm): upgrade to 2.0.15 or later. Junglewise finds every place you run it, drafts the upgrade and applies it once you approve.

**How is CVE-2021-23392 attacked?** It is attacked over the network, in a software library.

**Am I affected by CVE-2021-23392?** Check whether you run locutus (npm) at an affected version. Junglewise does that check for you around the clock: connect your code, cloud and domains, and it matches new vulnerabilities like this one against what you actually run and tells you when one reaches you.

## How to fix

- locutus (npm): upgrade to 2.0.15 or later

  ```sh
  npm install locutus@2.0.15
  ```


## Technical details

The locutus package before version 2.0.15 is vulnerable to a Regular Expression Denial of Service (ReDoS) within the `gopher_parsedir` function. The vulnerability is caused by an inefficient regular expression (`entryPattern`) that uses nested quantifiers and non-greedy matching, leading to catastrophic backtracking when processing certain malformed input strings containing many tab characters. An unauthenticated remote attacker can exploit this by providing a crafted string to the function, causing the JavaScript engine to consume excessive CPU cycles. This results in a denial of service (DoS) condition. The issue was fixed in version 2.0.15 by optimizing the regular expression to use negated character classes.

## Affected products

- locutusjs locutus < 2.0.15

## Identifiers

- CVE-2021-23392
- GHSA-39q4-p535-c852

## Timeline

- 2021-04-05: disclosed: Vulnerability disclosed to vendor
- 2021-05-27: patched: Fix merged into master branch and released in version 2.0.15
- 2021-06-08: advisory: NVD published CVE-2021-23392

## References

- [https://github.com/locutusjs/locutus/pull/446](https://github.com/locutusjs/locutus/pull/446)
- [https://github.com/locutusjs/locutus/commit/eb863321990e7e5514aa14f68b8d9978ece9e65e](https://github.com/locutusjs/locutus/commit/eb863321990e7e5514aa14f68b8d9978ece9e65e)
- [https://snyk.io/vuln/SNYK-JS-LOCUTUS-1090597](https://snyk.io/vuln/SNYK-JS-LOCUTUS-1090597)

## Related threats

- [Locutus prototype pollution in parse_str](https://junglewise.ai/threats/cve-2026-33994-locutus-prototype-pollution-in-parse-str)
- [Locutus prototype pollution via __proto__ injection in unserialize](https://junglewise.ai/threats/cve-2026-33993-locutus-prototype-pollution-via-proto-injection-in-unserialize)
- [Locutus code injection in create_function](https://junglewise.ai/threats/cve-2026-32304-locutus-code-injection-in-create-function)
- [Locutus remote code execution in call_user_func_array](https://junglewise.ai/threats/cve-2026-29091-locutus-remote-code-execution-in-call-user-func-array)
- [Locutus prototype pollution in parse_str function](https://junglewise.ai/threats/cve-2026-25521-locutus-prototype-pollution-in-parse-str-function)
