Description
Shescape is a simple shell escape library for JavaScript. From 2.1.11 until 2.1.14 and 3.0.1, the flag-protection loop in compose in src/internal/compose.js repeatedly joins and slices flag fragments when flagProtection is enabled, which is the default, making processing quadratic in input size across the escape, escapeAll, quote, and quoteAll APIs. An attacker who can supply a large untrusted input containing many flag fragments can consume CPU and cause denial of service. This issue is fixed in versions 2.1.14 and 3.0.1.
Published: 2026-08-12
Score: 8.7 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

Shescape, a lightweight JavaScript shell‑escape library, contains a quadratic‑time loop in its flag‑protection mechanism for the escape, escapeAll, quote, and quoteAll APIs. When flagProtection is enabled—the default state—the library repeatedly joins and slices flag fragments, resulting in CPU consumption that grows quadratically with input size. The flaw gives an attacker who can supply a large untrusted string containing numerous flag fragments the ability to exhaust processing resources and trigger a denial‑of‑service condition. This is a classic resource‑exhaustion weakness (CWE‑400, CWE‑407).

Affected Systems

Affected product: shescape maintained by ericcornelissen. Versions 2.1.11 through 2.1.13 and any 3.0.x releases earlier than 3.0.1 are vulnerable. The vulnerability was patched in 2.1.14 and released as 3.0.1. All other existing releases prior to these fixes remain susceptible.

Risk and Exploitability

The CVSS score of 8.7 classifies the issue as high severity. No EPSS value is reported, so current exploit probability is unknown, but the lack of a KEV entry suggests no publicly observed exploitation yet. An attacker can trigger the defect by feeding a sufficiently large input to any component that uses the vulnerable shescape functions; local or remote exploitation is possible wherever untrusted data reaches these APIs. The attack does not require privileged access or a separate vulnerability; it simply consumes CPU resources to deny service.

Generated by OpenCVE AI on August 12, 2026 at 23:13 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Upgrade shescape to version 2.1.14 or later, or to 3.0.1 or later, to remove the quadratic‑time loop.
  • If upgrading is not immediately feasible, validate or truncate input before passing it to shescape’s escape or quote functions to prevent excessive flag fragment processing.
  • Implement resource‑usage monitoring or rate‑limiting on the code paths that invoke shescape so that sustained high CPU consumption can be detected and mitigated before a denial‑of‑service occurs.

Generated by OpenCVE AI on August 12, 2026 at 23:13 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Github GHSA Github GHSA GHSA-gm3r-q2wp-hw87 Shescape: Quadratic-time denial of service in the flag-protection
History

Thu, 13 Aug 2026 15:30:00 +0000

Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'yes', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}


Wed, 12 Aug 2026 21:30:00 +0000

Type Values Removed Values Added
First Time appeared Ericcornelissen
Ericcornelissen shescape
Vendors & Products Ericcornelissen
Ericcornelissen shescape

Wed, 12 Aug 2026 19:45:00 +0000

Type Values Removed Values Added
Description Shescape is a simple shell escape library for JavaScript. From 2.1.11 until 2.1.14 and 3.0.1, the flag-protection loop in compose in src/internal/compose.js repeatedly joins and slices flag fragments when flagProtection is enabled, which is the default, making processing quadratic in input size across the escape, escapeAll, quote, and quoteAll APIs. An attacker who can supply a large untrusted input containing many flag fragments can consume CPU and cause denial of service. This issue is fixed in versions 2.1.14 and 3.0.1.
Title Shescape: Quadratic-time denial of service in flag-protection
Weaknesses CWE-400
CWE-407
References
Metrics cvssV4_0

{'score': 8.7, 'vector': 'CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N'}


Subscriptions

Ericcornelissen Shescape
cve-icon MITRE

Status: PUBLISHED

Assigner: GitHub_M

Published:

Updated: 2026-08-13T14:18:12.252Z

Reserved: 2026-08-12T14:32:11.795Z

Link: CVE-2026-73413

cve-icon Vulnrichment

Updated: 2026-08-13T14:18:03.252Z

cve-icon NVD

Status : Received

Published: 2026-08-12T20:17:56.350

Modified: 2026-08-13T15:20:14.190

Link: CVE-2026-73413

cve-icon Redhat

No data.

cve-icon OpenCVE Enrichment

Updated: 2026-08-12T23:15:03Z

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity