CVE-2026-30837
JSON

7.5high

Elysia has a string URL format redos

Severity
7.5high CVSS:3.1 by GitHub_M
Exploit likelihood
0.60% (higher than 43% of CVEs)
Published
Last changed
Assigned by
GitHub_M
Also known as
GHSA-f45g-68q3-5w8x

Description

Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Prior to 1.4.26 , t.String({ format: 'url' }) is vulnerable to ReDoS. Repeating a partial url format (protocol and hostname) multiple times cause regex to slow down significantly. This vulnerability is fixed in 1.4.26.

Affected

Product or packageVersionsReported by
elysiajs elysia< 1.4.26, before 1.4.26CVE List, NVD
elysia (npm)before 1.4.26GitHub Advisory Database

All scores

GitHub_M7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
GitHub7.5high CVSS:3.1CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Classification

CWE-1333

SSVC (CISA-ADP): exploitation none, automatable yes, technical impact partial.

What each source says

CVE List

Elysia is a Typescript framework for request validation, type inference, OpenAPI documentation and client-server communication. Prior to 1.4.26 , t.String({ format: 'url' }) is vulnerable to ReDoS. Repeating a partial url format (protocol and hostname) multiple times cause regex to slow down significantly. This vulnerability is fixed in 1.4.26.

GitHub Advisory Database
Impact

t.String({ format: 'url' }) is vulnerable to redos

Repeating a partial url format (protocol and hostname) multiple times cause regex to slow down significantly

'http://a'.repeat(n)

Here's a table demonstrating how long it takes to process repeated partial url format

n repeatelapsed_ms
102433.993
2048134.357
4096537.608
81922155.842
163848618.457
3276834604.139
Patches

Patched by 1.4.26, please kindly update elysia to >= 1.4.26

Here's how long it takes after the patch

n repeatelapsed_ms
10240.194
20480.274
40960.455
81920.831
163841.632
327683.052
Workarounds
  1. It's recommended to always limit URL format to a reasonable length
t.String({
	format: 'url',
	maxLength: 288
})
  1. If a long URL format is necessary, to patch this without updating to 1.4.26, add the following code to any part of your codebase
import { FormatRegistry } from '@sinclair/typebox'

FormatRegistry.Delete('url')
FormatRegistry.Set('url', (value) =>
	/^(?:https?|ftp):\/\/(?:[^\s:@]+(?::[^\s@]*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu.test(
		value
	)
)
NVD (es)

Elysia es un framework de Typescript para validación de solicitudes, inferencia de tipos, documentación OpenAPI y comunicación cliente-servidor. Antes de la 1.4.26, t.String({ format: 'url' }) es vulnerable a ReDoS. Repetir un formato de url parcial (protocolo y nombre de host) varias veces causa que la expresión regular se ralentice significativamente. Esta vulnerabilidad está corregida en la 1.4.26.

References

Sources

SourceRecordLicence
CVE ListCVE-2026-30837 changed 2026-03-11CVE Terms of Use
GitHub Advisory DatabaseGHSA-f45g-68q3-5w8x changed 2026-03-13CC-BY-4.0
NVDCVE-2026-30837 changed 2026-06-17Public domain