{"id":"CVE-2026-121707","aliases":["GHSA-7589-6fvf-x4pw"],"url":"https://o3.security/vulnerability/CVE-2026-121707","summary":"Effect: ReDoS in Schema.TemplateLiteral compiled regex","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'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:\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.","published":"2026-11-17T19:28:56.438Z","modified":"2026-11-19T20:45:39.438818426Z","cvss":null,"epss":{"score":0.00301,"percentile":0.233,"asOf":"2026-11-19"},"cisaKev":null,"exploitsKnown":0,"affectedPackages":[{"ecosystem":"npm","name":"effect","fixedVersion":"3.22.1"}],"fix":{"url":"https://github.com/Effect-TS/effect/commit/3cc3c6e1a64cbdc360e9d28e44f3ec3ce0ece6e3","label":"Effect-TS/effect@3cc3c6e"},"references":[{"type":"WEB","url":"https://github.com/Effect-TS/effect/releases/tag/effect@3.22.1"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/121xxx/CVE-2026-121707.json"},{"type":"ADVISORY","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":"FIX","url":"https://github.com/Effect-TS/effect/commit/3cc3c6e1a64cbdc360e9d28e44f3ec3ce0ece6e3"},{"type":"FIX","url":"https://github.com/Effect-TS/effect/pull/6761"},{"type":"PACKAGE","url":"https://github.com/Effect-TS/effect"}],"provenance":{"sources":["OSV.dev","FIRST.org (EPSS)"],"lastVerified":"2026-11-19T20:45:39.438818426Z"}}