GHSA-7589-6FVF-X4PW
Vulnerability from github – Published: 2026-11-19 20:51 – Updated: 2026-11-19 20:51Impact
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.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 3.22.0"
},
"package": {
"ecosystem": "npm",
"name": "effect"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "3.22.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-121707"
],
"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"
},
"details": "### Impact\n\n`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:\n\n```ts\nSchema.TemplateLiteral(Schema.String, \":\", Schema.String, \":\", Schema.String, \"X\")\n```\n\nthe 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.\n\nApplications 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.\n\n### Patches\n\nFixed 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.\n\n### Workarounds\n\nIf you can\u0027t upgrade, check the input length before the template literal runs. Adding `Schema.maxLength` with `.pipe` doesn\u0027t help, because the filter runs after the regex. Put the length check on the input side instead:\n\n```ts\nSchema.compose(Schema.String.pipe(Schema.maxLength(256)), MyTemplateLiteral)\n```\n\nRejecting oversized request bodies before they reach the schema also works.",
"id": "GHSA-7589-6fvf-x4pw",
"modified": "2026-11-19T20:51:01Z",
"published": "2026-11-19T20:51:01Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/Effect-TS/effect/security/advisories/GHSA-7589-6fvf-x4pw"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-121707"
},
{
"type": "WEB",
"url": "https://github.com/Effect-TS/effect/pull/6761"
},
{
"type": "WEB",
"url": "https://github.com/Effect-TS/effect/commit/3cc3c6e1a64cbdc360e9d28e44f3ec3ce0ece6e3"
},
{
"type": "PACKAGE",
"url": "https://github.com/Effect-TS/effect"
},
{
"type": "WEB",
"url": "https://github.com/Effect-TS/effect/releases/tag/effect@3.22.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "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",
"type": "CVSS_V4"
}
],
"summary": "Effect: ReDoS in Schema.TemplateLiteral compiled regex"
}
Sightings
| Author | Source | Type | Date | Other |
|---|
Nomenclature
- Seen: The vulnerability was mentioned, discussed, or observed by the user.
- Confirmed: The vulnerability has been validated from an analyst's perspective.
- Published Proof of Concept: A public proof of concept is available for this vulnerability.
- Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
- Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
- Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
- Not confirmed: The user expressed doubt about the validity of the vulnerability.
- Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.
The approach is described in our paper Mapping CVEs to MITRE ATT&CK Techniques: A Curated Gold-Set Classifier and the Limits of LLM-Assisted Label Expansion.
Browse all ATT&CK techniques and the vulnerabilities related to each.
Related by attack behaviour
Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.