HIGH · CVSS 4.0 EPSS 0.5% · 43th percentile CWE-1333

CVE-2026-121707: Effect: ReDoS in Schema.TemplateLiteral compiled regex

Published 2026-11-19 · Updated 2026-11-19 · Also known as GHSA-7589-6fvf-x4pw

Summary

The Effect library's Schema.TemplateLiteral implementation contains a Regular Expression Denial of Service (ReDoS) vulnerability due to ambiguous wildcards. Developers using Effect schemas to decode untrusted input should upgrade to the latest version to prevent potential event loop blocking.

Who is affected

The vulnerability affects applications that use Schema.TemplateLiteral with multiple string spans to decode untrusted input, including those using Schema.decodeUnknown, HttpApi, or @effect/rpc. When processing crafted non-matching inputs, the regex engine triggers excessive backtracking that causes exponential growth in matching time, leading to significant CPU consumption and event loop starvation.

Exploitability

The vulnerability is rated as High severity, indicating a significant potential for service disruption. With a CVSS 4.0 attack vector of Network and an EPSS score of 0.003, the flaw is remotely exploitable without authentication, though there is no current evidence of active exploitation via the CISA KEV catalog.

Remediation

How to check your project

Automated analysis of the published advisory data, generated 2026-11-19. Not human-reviewed; verify against the official advisory. How this works.

Affected packages

EcosystemPackageAffected versionsFixed inUpgrade
npm effect >= 0, < 3.22.1 3.22.1 npm install [email protected]

CVSS 4.0 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

Attack vectorNetwork
Attack complexityLow
Attack requirementsNone
Privileges requiredNone
User interactionNone
Confidentiality (vulnerable system)None
Integrity (vulnerable system)None
Availability (vulnerable system)High
Confidentiality (subsequent systems)None
Integrity (subsequent systems)None
Availability (subsequent systems)None

Base score is not computed for CVSS 4.0 vectors; severity is taken from the advisory.

FAQ

Is my application affected if I don't use TemplateLiteral?

No, this specific vulnerability is isolated to the Schema.TemplateLiteral implementation within the Effect library.

Does adding Schema.maxLength directly to the TemplateLiteral schema fix the issue?

No, because the filter runs after the vulnerable regex has already been executed. You must validate the length of the input before it is processed by the template literal schema.

Has this vulnerability been exploited in the wild?

No, CISA has not listed this vulnerability in its Known Exploited Vulnerabilities catalog.

Original advisory description
### 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 `[email protected]` (#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.

References

Source records: GHSA-7589-6fvf-x4pw (OSV.dev) · EPSS by FIRST, 2026-11-22.