CVE-2023-26103
Description
Versions of the package deno before 1.31.0 are vulnerable to Regular Expression Denial of Service (ReDoS) due to the upgradeWebSocket function, which contains regexes in the form of /s*,s*/, used for splitting the Connection/Upgrade header. A specially crafted Connection/Upgrade header can be used to significantly slow down a web socket server.
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Deno before 1.31.0 is vulnerable to ReDoS via crafted Connection/Upgrade headers in the upgradeWebSocket function.
CVE-2023-26103 describes a Regular Expression Denial of Service (ReDoS) vulnerability in the Deno runtime, affecting versions prior to 1.31.0. The root cause lies in the upgradeWebSocket function within ext/http/01_http.js. This function uses a regex pattern /s*,s*/ to split the Connection and Upgrade headers [1][4]. When a specially crafted header containing many commas and whitespace characters is supplied, the regex engine can encounter catastrophic backtracking, consuming CPU resources disproportionately to the input size [1][3].
To exploit this vulnerability, an attacker must be able to send HTTP requests to a Deno server that utilizes WebSocket upgrades. No authentication is required if the server endpoint is exposed publicly. The attack involves sending a crafted Connection or Upgrade header with a carefully constructed sequence of spaces and commas, which causes the regex matching to take exponential time to process [1][3]. This is a classic ReDoS attack vector, where a seemingly simple regex can be forced into a worst-case performance scenario by malicious input.
The impact of successful exploitation is a Denial of Service condition: the affected server process becomes unresponsive or significantly slowed while processing the malicious header. An attacker can tie up server resources, making the WebSocket server unavailable for legitimate requests. There is no data breach or code execution risk, but the attack can disrupt service availability [1][3].
Mitigation is straightforward: users should upgrade Deno to version 1.31.0 or later, as released on February 23, 2023 [2]. The fix addresses the regex pattern to prevent catastrophic backtracking. No workaround is listed for unpatched versions; upgrading is the recommended action [1][2].
AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected packages
Versions sourced from the GitHub Security Advisory.
| Package | Affected versions | Patched versions |
|---|---|---|
denocrates.io | >= 1.12.0, < 1.31.0 | 1.31.0 |
Affected products
2- deno/denodescription
Patches
1cf06a7c7e672refactor(ext/http): use `String.prototype.trim()` instead of regex (#17722)
1 file changed · +7 −4
ext/http/01_http.js+7 −4 modified@@ -51,6 +51,7 @@ const { StringPrototypeIncludes, StringPrototypeToLowerCase, StringPrototypeSplit, + StringPrototypeTrim, Symbol, SymbolAsyncIterator, TypeError, @@ -393,8 +394,9 @@ function upgradeWebSocket(request, options = {}) { const upgrade = request.headers.get("upgrade"); const upgradeHasWebSocketOption = upgrade !== null && ArrayPrototypeSome( - StringPrototypeSplit(upgrade, /\s*,\s*/), - (option) => StringPrototypeToLowerCase(option) === "websocket", + StringPrototypeSplit(upgrade, ","), + (option) => + StringPrototypeToLowerCase(StringPrototypeTrim(option)) === "websocket", ); if (!upgradeHasWebSocketOption) { throw new TypeError( @@ -405,8 +407,9 @@ function upgradeWebSocket(request, options = {}) { const connection = request.headers.get("connection"); const connectionHasUpgradeOption = connection !== null && ArrayPrototypeSome( - StringPrototypeSplit(connection, /\s*,\s*/), - (option) => StringPrototypeToLowerCase(option) === "upgrade", + StringPrototypeSplit(connection, ","), + (option) => + StringPrototypeToLowerCase(StringPrototypeTrim(option)) === "upgrade", ); if (!connectionHasUpgradeOption) { throw new TypeError(
Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
9- github.com/advisories/GHSA-jc97-h3h9-7xh6ghsaADVISORY
- nvd.nist.gov/vuln/detail/CVE-2023-26103ghsaADVISORY
- github.com/denoland/deno/blob/2b247be517d789a37e532849e2e40b724af0918f/ext/http/01_http.jsghsaWEB
- github.com/denoland/deno/commit/cf06a7c7e672880e1b38598fe445e2c50b4a9d06ghsaWEB
- github.com/denoland/deno/pull/17722ghsaWEB
- github.com/denoland/deno/releases/tag/v1.31.0ghsaWEB
- github.com/denoland/deno/security/advisories/GHSA-jc97-h3h9-7xh6ghsaWEB
- security.snyk.io/vuln/SNYK-RUST-DENO-3315970ghsaWEB
- github.com/denoland/deno/blob/2b247be517d789a37e532849e2e40b724af0918f/ext/http/01_http.js%23L395-L409mitre
News mentions
0No linked articles in our index yet.