CVE-2026-73413

Shescape: Quadratic-time denial of service in flag-protection

Published Aug 12, 2026 CVSS 4.0 · 8.7 High EPSS < 1% KEV · Not listed
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.

Analysis

AI-generated

Technical 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.

Remediation

No solution or workaround provided in the CVE record.

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
Type Values Removed Values Added
Metrics ssvc

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

Type Values Removed Values Added
First Time appeared Ericcornelissen
Ericcornelissen shescape
Vendors & Products Ericcornelissen
Ericcornelissen shescape
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'}

Weaknesses
  • CWE-400

    Uncontrolled Resource Consumption

  • CWE-407

    Inefficient Algorithmic Complexity

Sources

Status
PUBLISHED
Assigner
GitHub_M
Published
Updated
Aug 13, 2026, 2:18 PM
Reserved
Aug 12, 2026, 2:32 PM
Status
Deferred
Published
Aug 12, 2026, 8:17 PM
Modified
Oct 24, 2026, 3:10 PM