GHSA-7589-6fvf-x4pw

Suggest an improvement
Source
https://github.com/advisories/GHSA-7589-6fvf-x4pw
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-7589-6fvf-x4pw/GHSA-7589-6fvf-x4pw.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-7589-6fvf-x4pw
Aliases
Published
2026-11-19T20:51:01Z
Modified
2026-11-19T21:00:03Z
Severity
  • 8.7 (High) CVSS_V4 - 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 CVSS Calculator
Summary
Effect: ReDoS in Schema.TemplateLiteral compiled regex
Details

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 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:

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

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

Database specific
{
    "cwe_ids": [
        "CWE-1333"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-19T20:51:01Z",
    "nvd_published_at": "2026-11-17T20:17:36Z",
    "severity": "HIGH"
}
References

Affected packages

npm / effect

Package

Affected ranges

Type
SEMVER
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
3.22.1

Database specific

last_known_affected_version_range
"<= 3.22.0"
source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-7589-6fvf-x4pw/GHSA-7589-6fvf-x4pw.json"