Effect: ReDoS in Schema.TemplateLiteral compiled regexGHSA-7589-6fvf-x4pw
Fix: Effect-TS/effect#6761GHSA-7589-6fvf-x4pw is a CWE-1333 vulnerability in effect. A fix is available for effect — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-7589-6fvf-x4pw.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
Real-World Exposure
effectReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects npm packages — download data is not available via public APIs for these ecosystems.
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:
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:
Schema.compose(Schema.String.pipe(Schema.maxLength(256)), MyTemplateLiteral)
Rejecting oversized request bodies before they reach the schema also works.
Affected Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| 📦npm | effect | all versions | 3.22.1npm install effect@3.22.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for effect, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update effect to 3.22.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-7589-6fvf-x4pw is resolved across your whole dependency graph.
Workarounds
If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.
Frequently Asked Questions
Is GHSA-7589-6fvf-x4pw in your dependencies?
Find it across npm, including transitive dependencies.