Dev.to Security πŸ” Cybersecurity πŸ‘ 0 πŸ“– 3 min read

CVE-2026-121707: CVE-2026-121707: Regular Expression Denial of Service (ReDoS) in Effect Schema.TemplateLiteral

CVE-2026-121707: Regular Expression Denial of Service (ReDoS) in Effect Schema.TemplateLiteral Vulnerability ID: CVE-2026-121707 CVSS Score: 8.7 Published: 2026-11-19 CVE-2026-121707 is a high-severity Regular Expre

CVE-2026-121707: Regular Expression Denial of Service (ReDoS) in Effect Schema.TemplateLiteral

Vulnerability ID: CVE-2026-121707
CVSS Score: 8.7
Published: 2026-11-19

CVE-2026-121707 is a high-severity Regular Expression Denial of Service (ReDoS) vulnerability in the Effect TypeScript library prior to version 3.22.1. When evaluating untrusted input against Schema.TemplateLiteral definitions containing multiple string spans, the dynamically compiled regular expression exhibits polynomial backtracking complexity. Because JavaScript runtimes execute on a single-threaded event loop, processing specially crafted non-matching strings causes synchronous CPU starvation and complete application unresponsiveness.

TL;DR

Effect versions prior to 3.22.1 compile Schema.TemplateLiteral string spans into overlapping lazy wildcard regular expressions ([\s\S]*?). Supplying repeated delimiter characters without the expected suffix triggers polynomial O(N^k) backtracking, blocking the JavaScript event loop and causing a remote denial of service.

⚠️ Exploit Status: POC

Technical Details

  • CVE / GHSA ID: CVE-2026-121707 / GHSA-7589-6fvf-x4pw
  • Weakness Class: CWE-1333: Inefficient Regular Expression Complexity (ReDoS)
  • CVSS v4.0 Score: 8.7 HIGH (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)
  • EPSS Score: 0.301% (23.30th Percentile)
  • Affected Package: effect < 3.22.1 (npm)
  • Patched Version: effect >= 3.22.1
  • Primary Impact: Single-Threaded JavaScript Event Loop Starvation / Denial of Service
  • CISA KEV Status: Not Listed

Affected Systems

  • Effect-TS 'effect' npm package (< 3.22.1)
  • Applications utilizing Schema.TemplateLiteral with two or more Schema.String spans
  • Downstream services validating untrusted input via Schema.decodeUnknown, HttpApi, or @effect/rpc
  • effect: < 3.22.1 (Fixed in: 3.22.1)

Code Analysis

Commit: 3cc3c6e

Use linear matcher for string template literals (#6761)

@@ -876,6 +876,24 @@ const go = (ast: AST.AST, isDecoding: boolean): Parser => {
     case "Enums":
       return fromRefinement(ast, (u): u is any => ast.enums.some(([_, value]) => value === u))
     case "TemplateLiteral": {
+      if (ast.spans.every((span) => AST.isStringKeyword(span.type))) {
+        return fromRefinement(ast, (u): u is any => {
+          if (!Predicate.isString(u) || !u.startsWith(ast.head)) {
+            return false
+          }
+          let position = ast.head.length
+          for (let i = 0; i < ast.spans.length - 1; i++) {
+            const literal = ast.spans[i].literal
+            const index = u.indexOf(literal, position)
+            if (index === -1) {
+              return false
+            }
+            position = index + literal.length
+          }
+          const literal = ast.spans[ast.spans.length - 1].literal
+          return u.endsWith(literal) && u.length - literal.length >= position
+        })
+      }
       const regex = AST.getTemplateLiteralRegExp(ast)
       return fromRefinement(ast, (u): u is any => Predicate.isString(u) && regex.test(u))
     }

Exploit Details

  • GitHub Security Advisory: Official advisory containing reproduction details for polynomial backtracking in Schema.TemplateLiteral.

Mitigation Strategies

  • Upgrade the 'effect' npm package to version 3.22.1 or later to utilize the deterministic O(N) linear string matcher for TemplateLiteral schemas.
  • Constrain input lengths on untrusted string fields prior to schema validation to bound the worst-case algorithmic complexity.
  • Replace vulnerable multi-span Schema.TemplateLiteral constructs with explicit negated-character-class regular expressions (e.g., [^.]*) where spans cannot overlap with delimiters.

Remediation Steps:

  1. Run 'npm install effect@^3.22.1' (or the equivalent pnpm/yarn upgrade command) in all affected repositories.
  2. Audit lockfiles ('npm ls effect') to confirm that all direct and transitive resolutions of 'effect' are at version 3.22.1 or higher.
  3. Review any hybrid Schema.TemplateLiteral definitions that mix multiple Schema.String spans with Schema.Number spans, and apply explicit Schema.maxLength constraints.
  4. Run application test suites and redeploy affected Node.js, Deno, or Bun services.

References

Read the full report for CVE-2026-121707 on our website for more details including interactive diagrams and full exploit analysis.

πŸ“° Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes β€” full credit and traffic to the original publisher.