Mar 10, 2026·6 min read·49 visits
Unauthenticated remote attackers can cause a Denial of Service (DoS) by sending crafted strings to endpoints utilizing Elysia's t.String({ format: 'url' }) schema validation.
A critical Regular Expression Denial of Service (ReDoS) vulnerability in the Elysia TypeScript framework allows unauthenticated remote attackers to cause severe CPU exhaustion. The flaw exists in the TypeBox-backed URL validation schema, affecting all versions prior to 1.4.26.
The vulnerability resides in the URL validation logic within Elysia's schema system, which utilizes TypeBox for input validation. The framework implements a global FormatRegistry to store regular expression patterns for common string formats, including URLs, emails, and UUIDs. When a developer defines a schema requiring URL validation via t.String({ format: 'url' }), the framework evaluates incoming data against the registered URL regular expression.
This validation process occurs synchronously on the main thread prior to executing the route handler. Due to an inefficient regular expression complexity flaw (CWE-1333) in the URL format pattern, the validation logic is susceptible to a Regular Expression Denial of Service (ReDoS) attack. Remote attackers can exploit this flaw to cause catastrophic backtracking in the regex engine, leading to severe CPU exhaustion.
The vulnerability affects all Elysia versions prior to 1.4.26. Because Node.js and Bun utilize a single-threaded event loop architecture, a blocked thread prevents the server from processing any subsequent requests. A single malicious request can render the application unresponsive, making this a highly effective Denial of Service vector.
The root cause of this vulnerability is catastrophic backtracking located in the user-info and hostname segments of the URL regular expression. The framework implemented an overly permissive pattern to validate the username:password@ section of a URL. The regex engine struggles to efficiently process strings that partially match this pattern but fail to complete it.
The specific vulnerable regex segment is (?:\S+(?::\S*)?@)?. In this pattern, the non-whitespace quantifier \S+ is greedy. It overlaps with the optional password component (?::\S*)?. Both segments attempt to consume the same non-whitespace characters from the input string.
When an input string contains a long sequence of non-whitespace characters but lacks the terminal @ character, the regex engine enters a state explosion. It attempts every possible permutation of dividing the input string between the initial greedy match and the optional secondary match. This results in exponential evaluation time relative to the input length.
The following diagram illustrates the backtracking execution path when the terminal character is absent:
The mitigation requires modifying the regular expression to ensure the match paths are mutually exclusive. The fix was introduced in commit d17a7aa204b5feea65d6d8f7651fb7141fb322bd, updating the FormatRegistry initialization logic for the URL pattern. The patch replaces the generic non-whitespace quantifiers with specific character classes.
The following code block demonstrates the difference between the vulnerable and patched regex segments:
// Vulnerable Regex Segment
const vulnerable = /(?:\S+(?::\S*)?@)?/;
// Patched Regex Segment
const patched = /(?:[^\s:@]+(?::[^\s@]*)?@)?/;The fixed version substitutes \S+ with [^\s:@]+ and \S* with [^\s@]*. By explicitly excluding the : and @ delimiters from the repeating groups, the regex engine is forced to fail linearly. When the engine encounters a sequence of characters without the required delimiters, it immediately halts the matching process for that segment.
This patch completely eliminates the exponential backtracking path. Benchmarks indicate that the validation time for a 32,768-character payload drops from approximately 34.6 seconds down to 3.05 milliseconds. The fix is comprehensive for this specific user-info segment overlap.
Exploitation requires no authentication and relies solely on sending a crafted HTTP request to an endpoint that validates URL parameters. An attacker constructs a payload consisting of a valid URL scheme followed by an exceptionally long string of non-whitespace characters. The payload must omit the @ symbol to trigger the backtracking loop.
A reliable proof-of-concept payload uses the structure 'http://a'.repeat(n). When n equals 32,768, the input length is sufficient to stall the event loop for over 30 seconds on standard hardware. The attacker packages this payload into a JSON body and transmits it via a standard POST request.
The following snippet demonstrates the exploitation methodology:
const n = 32768;
const payload = {
link: 'http://a'.repeat(n)
};
fetch('http://localhost:3000/validate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(payload)
});Public proof-of-concept code is available at https://github.com/EdamAme-x/elysia-poc-redos. Attackers utilizing this PoC can easily automate the transmission of multiple payloads. Sending concurrent malicious requests ensures the server remains perpetually locked, resulting in a sustained Denial of Service condition.
The vulnerability carries a CVSS v3.1 base score of 7.5, categorized as High severity. The vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H reflects the network attack vector, low complexity, lack of required privileges, and the high impact on system availability.
Confidentiality and integrity are not impacted by this flaw. The attacker cannot execute arbitrary code, read sensitive memory, or modify system data. The sole consequence is the complete exhaustion of CPU resources, leading to an application hang.
Because the event loop is blocked synchronously, legitimate user requests queue indefinitely or time out. In cloud environments utilizing auto-scaling, this behavior can trigger unintended scaling events. The application instances will consume 100% CPU, potentially resulting in inflated infrastructure costs before the health checks eventually terminate the unresponsive containers.
The primary and most effective remediation is upgrading the Elysia framework to version 1.4.26 or later. This release contains the updated TypeBox FormatRegistry patterns that resolve the catastrophic backtracking flaw. Development teams should audit their package.json and lockfiles to ensure no transitive dependencies are locking Elysia to a vulnerable version.
If immediate patching is impossible, developers can mitigate the risk by enforcing strict length boundaries on string inputs. Setting a maxLength property on the schema definition bounds the maximum processing time. For example, restricting URLs to 288 characters prevents the regex engine from entering prolonged backtracking cycles.
Alternatively, developers can manually override the vulnerable regular expression within the FormatRegistry. By importing FormatRegistry from @sinclair/typebox, administrators can delete the existing url format and set a custom, safe regular expression pattern. This temporary workaround protects the application without requiring a framework version bump.
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
elysia ElysiaJS | < 1.4.26 | 1.4.26 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-1333 |
| Attack Vector | Network |
| CVSS v3.1 Score | 7.5 (High) |
| Impact | Denial of Service (Availability: High) |
| Exploit Status | Proof-of-Concept Available |
| Affected Component | t.String({ format: 'url' }) |
The regular expression engine's complexity scales exponentially with the input size when encountering overlapping groups and lacking a terminal character.
CVE-2026-119203 is a denial-of-service vulnerability affecting the pypdf library in versions prior to 6.21.4. The flaw occurs within the standard cross-reference (xref) table parsing routine when processing truncated or malformed PDF streams that terminate before a valid trailer dictionary is encountered. Because the parser attempts to rewind the stream pointer by a fixed offset whenever the trailer token is absent without verifying forward progress, hitting the end-of-file (EOF) or non-advancing tokens causes the parser to re-read the same byte offset indefinitely. An unauthenticated attacker can exploit this flaw by supplying a crafted PDF document to an application using pypdf, resulting in continuous CPU consumption and thread exhaustion.
Prior to version 2.18.0, the Kubeflow Pipelines API server contains a missing authorization and confused deputy vulnerability in its run log streaming endpoint. The HTTP handler for `GET /apis/v1alpha1/runs/{run_id}/nodes/{node_id}/log` fails to propagate incoming request headers to gRPC metadata and omits caller authorization checks against the requested run. Furthermore, the backend accepts the caller-supplied `node_id` parameter directly as a Kubernetes pod name without verifying that the pod belongs to the specified pipeline run. An attacker with network access to the API server who knows a valid run identifier can read live or archived execution logs from any pod containing a `main` container within the run's Kubernetes namespace.
A high-severity Denial of Service (DoS) vulnerability exists in Kubeflow Pipelines prior to version 2.18.0 due to improper handling of highly compressed archive files (CWE-409). The API server decompresses uploaded ZIP and gzip-compressed TAR archives directly into memory without bounding the expanded byte stream or archive traversal metadata. Because decompression occurs before namespace-level authorization in multipart upload handlers, an unauthenticated or unauthorized attacker with network access to the API server can exhaust container heap memory and trigger Out-Of-Memory (OOM) terminations.
A credential exposure vulnerability exists in the @sigstore/oci library prior to version 0.7.2. The RegistryClient implementation stores sensitive authentication headers, including Bearer tokens, Basic authentication credentials, and custom Docker configuration headers, as client-wide defaults on its shared HTTP client instance. When uploading binary blobs via the OCI distribution specification, the client extracts the target upload URI from the server-supplied Location header and dispatches an independent HTTP PUT request. If a compromised or untrusted registry returns a cross-origin URI in the Location header, the client transmits the stored authentication credentials directly to the third-party host.
An OS command injection and argument injection vulnerability exists in the Nx build system and its official Maven (@nx/maven) and Gradle (@nx/gradle) plugins. When constructing the project dependency graph, the plugins invoke underlying Java build wrappers via subshells while interpolating unsanitized plugin options directly from nx.json into the command arguments. An attacker who supplies a crafted nx.json file via a repository or pull request can execute arbitrary shell commands with the privileges of the user or CI/CD runner invoking any Nx command that computes the project graph.
AdminNeo versions 4.6.2 through 5.4.1 contain an improper input validation vulnerability (CWE-20) in the version verification endpoint (?script=version). An unauthenticated remote attacker can submit a crafted HTTP POST request containing an array parameter for 'version', which is serialized into a shared server-side temporary cache file without type checking or authentication. On subsequent requests, the application deserializes this cached array and passes it to cookie() and rawurlencode(), triggering an uncaught fatal TypeError in PHP 8.x environments and causing a persistent 24-hour Denial of Service (DoS) for all users.