High

Effect: ReDoS in Schema.TemplateLiteral compiled regex

  • Disclosed: 19.11.2026
  • Updated: 20.11.2026 10:00

Impact

Schema.TemplateLiteral compiles each Schema.String span to the lazy wildcard [\s\S]*? and decodes input by running the resulting regular expression against it. When a template has two or more Schema.String spans, for example:

ts
Schema.TemplateLiteral(Schema.String, ":", Schema.String, ":", Schema.String, "X")

the regex contains several ambiguous wildcards. A non-matching input makes the backtracking engine try combinations across all of them, so matching time grows cubically with input length. A 5,000-character string of : characters blocks the event loop for about 15 seconds.

Applications that decode untrusted input with such a schema are affected. That includes Schema.decodeUnknown, Schema.decodeUnknownSync and Schema.is, and anything built on them, such as HttpApi request payloads and @effect/rpc payloads.

Patches

Fixed in effect@3.22.1 (#6761). Template literals whose spans are all Schema.String are now matched with a linear left-to-right scan instead of a regular expression.

Workarounds

If you can't upgrade, check the input length before the template literal runs. Adding Schema.maxLength with .pipe doesn't help, because the filter runs after the regex. Put the length check on the input side instead:

ts
Schema.compose(Schema.String.pipe(Schema.maxLength(256)), MyTemplateLiteral)

Rejecting oversized request bodies before they reach the schema also works.

What to do

Upgrade to effect@3.22.1 or later. If upgrading is not possible, enforce an input length check before the template literal runs or reject oversized request bodies prior to schema validation.

Affected software

Click a technology to see all vulnerabilities affecting it.

PlatformPackageVulnerable versionsFixed in
npm package effect < 3.22.1 3.22.1

References

CVSS score -
CVSS 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
Weakness (CWE)
CWE-1333
Platform
npm
Package
effect
Disclosed
19.11.2026
Updated
20.11.2026 10:00

Sources and licenses · Edited or translated by DockRay; source rights and applicable licenses are retained.

OSV / GitHub Advisory Database - GHSA-7589-6fvf-x4pw - CC BY 4.0

Vulnerability history: effect

All published vulnerabilities of this package (npm package), newest first. Shows whether this is a one-off slip or a package that needs watching.

Total entries
3
First → latest
03.2026 11.2026
Without a fix
0
Exploited in attacks
0

Severity breakdown

  • High 2
  • Medium 1

Disclosures per year

  1. 2026: 3
  1. Effect: ReDoS in Schema.TemplateLiteral compiled regex this entry
    High CVE-2026-121707 < 3.22.1 3.22.1
  2. Medium CVE-2026-115779 >= 4.0.0-beta.0, < 4.0.0-beta.103 4.0.0-beta.103

Know which vulnerabilities affect your application

With the DockRay integration and software inventory enabled, DockRay checks reported component versions against known vulnerabilities and notifies you about confirmed matches. Coverage depends on the supported technology and available advisory data.

Connect your application
DockRay newsletter

Application security in your inbox

Important vulnerabilities, actionable guidance and practical advice for your applications. Choose your technologies and follow what matters to your project.

  • A daily digest of new vulnerabilities, critical ones included.
  • Notifications about important updates.
  • Practical advice on application security and monitoring.

Leave empty to receive updates for every technology.

Free to subscribe. Unsubscribe with one click in any email.