{"vuln_id":"GHSA-r7hm-rjvg-xx7j","aliases":["CVE-2026-129302","CVE-2025-54365","CVE-2025-53539","GHSA-rrf6-pxg8-684g","GHSA-j47q-rc62-w448"],"description":"Guard Core: Quadratic ReDoS in built-in detection pattern freezes the event loop with a single request","published_at":"2026-11-19T22:49:33Z","modified_at":"2026-11-19T23:00:36.653178Z","first_seen_at":"2026-11-21T19:15:19.375340Z","severity":"high","severity_source":"ghsa","cvss_score":7.5,"cvss_vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","cwe":["CWE-400","CWE-1333"],"vendor":null,"product":null,"kev":{"is_kev":false,"date_added":null,"due_date":null,"ransomware":false},"epss":null,"epss_percentile":null,"nvd_status":null,"enriched_at":null,"links":{"nvd":"https://github.com/advisories/GHSA-r7hm-rjvg-xx7j"},"matched_alias":null,"items":[{"id":10713,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-r7hm-rjvg-xx7j: Guard Core: Quadratic ReDoS in built-in detection pattern freezes the event loop with a single request","summary":"Guard Core: Quadratic ReDoS in built-in detection pattern freezes the event loop with a single request\n\n### Summary\n\nA polynomial (quadratic) regular-expression denial of service in guard-core's built-in penetration-detection patterns allows any unauthenticated remote client to freeze **every** endpoint of an application for seconds per request, using only the default configuration. The triggering request completes without any detection match — no ban counter increments, no rate-limit violation is recorded — so it can be repeated indefinitely. Since guard-core 3.5.0, only *custom* patterns are executed through the compiler's timeout-protected `create_safe_matcher()`; all built-in patterns run as a bare, inline `pattern.search(content)` directly on the asyncio event loop. guard-core ≤ 3.4.0 ran built-ins through the safe matcher (verified in the 3.4.0 wheel, `_check_regex_pattern`), so this is a **regression introduced in 3.5.0** — and it silently undoes the protection credited to GHSA-rrf6-pxg8-684g (CVE-2025-54365) and the unbounded-quantifier remediation of GHSA-j47q-rc62-w448 (CVE-2025-53539) for every stock pattern, despite the changelog advertising \"Safe regex execution with configurable timeouts to prevent ReDoS attacks.\"\n\n### Details\n\n**1. The pattern** — `guard_core/handlers/suspatterns_handler.py:519` (master `08780f1`), the built-in template-injection detector:\n\n```python\nr\"\\{\\{\\s*[^\\}]+(?:system|exec|popen|eval|require|include)\\s*\\}\\}\"\n```\n\nOn an input of `{` repeated N times, every one of the N−1 positions starts a `\\{\\{` match attempt and `[^\\}]+` scans to end-of-string and backtracks once per position → O(N²). Note the sibling pattern at `:524` (`\\{\\%\\s*[^\\%]+...`) is **not** vulnerable — its delimiter `%` is excluded from the character class, keeping scans bounded — which confirms the root cause is the unbounded, non-excluding `[^\\}]+`.\n\n**2. The unprotected execution path** — `guard_core/handlers/suspatterns_handler.py:910-926`:\n\n```python\nif compiler:\n    if category == \"custom\":\n        safe_matcher = compiler.create_safe_matcher(pattern)   # executor + timeout\n        match = safe_matcher(content)\n        ...\n    else:\n        match = pattern.search(content)                        # ← inline, NO timeout\n```\n\nIn enhanced mode (the default whenever a `SecurityConfig` is present — `_supports_enhanced_config()` is a duck-type attribute check a stock config always passes), all built-in patterns execute inline **inside the async coroutine**, blocking the event loop for the full scan. In guard-core ≤ 3.4.0, `_check_regex_pattern()` routed *every* pattern through `self._compiler.create_safe_matcher(pattern.pattern)` (verified in the 3.4.0 wheel, `suspatterns_handler.py:565-567`) or, without a compiler, through `_check_pattern_with_timeout` (4-worker pool + per-pattern timeout). The `category == \"custom\"` exemption appeared in 3.5.0.\n\n**3. Default reachability** — penetration detection is on by default (`enable_penetration_detection=True`), query parameters are scanned by default (`guard_core/utils.py:843-865`), and the default scan windo\n\nAffected: PyPI:guard-core\n\nFixed in: 3.13.0\n\nReferences:\nhttps://github.com/Guard-Core/guard-core/security/advisories/GHSA-r7hm-rjvg-xx7j\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-129302\nhttps://github.com/Guard-Core/guard-core/pull/68\nhttps://github.com/Guard-Core/guard-core/commit/c07239fa1c5aa93e3f179440e79dad652977d3e4\nhttps://github.com/Guard-Core/guard-core/releases/tag/3.13.0\nhttps://github.com/rennf93/guard-core","url":"https://osv.dev/vulnerability/GHSA-r7hm-rjvg-xx7j","published_at":"2026-11-19T22:49:33Z","updated_at":"2026-11-19T23:00:36.653178Z","fetched_at":"2026-11-21T19:15:55.946124Z","severity":"high","cvss_score":7.8,"epss":0.00871,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"guard-core","vuln_id":"CVE-2026-129302","vuln_ids":["CVE-2025-53539","CVE-2025-54365","CVE-2026-129302","GHSA-J47Q-RC62-W448","GHSA-R7HM-RJVG-XX7J","GHSA-RRF6-PXG8-684G"],"tags":["osv","pypi","fix-available"],"cluster_id":2167,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10713","html":"https://vulnwatch.ve1ve2.com/item/10713"}},{"id":2370,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-r7hm-rjvg-xx7j / CVE-2026-129302: Guard Core: Quadratic ReDoS in built-in detection pattern freezes the event loop with a single request","summary":"Guard Core: Quadratic ReDoS in built-in detection pattern freezes the event loop with a single request\n\n### Summary\n\nA polynomial (quadratic) regular-expression denial of service in guard-core's built-in penetration-detection patterns allows any unauthenticated remote client to freeze **every** endpoint of an application for seconds per request, using only the default configuration. The triggering request completes without any detection match — no ban counter increments, no rate-limit violation is recorded — so it can be repeated indefinitely. Since guard-core 3.5.0, only *custom* patterns are executed through the compiler's timeout-protected `create_safe_matcher()`; all built-in patterns run as a bare, inline `pattern.search(content)` directly on the asyncio event loop. guard-core ≤ 3.4.0 ran built-ins through the safe matcher (verified in the 3.4.0 wheel, `_check_regex_pattern`), so this is a **regression introduced in 3.5.0** — and it silently undoes the protection credited to GHSA-rrf6-pxg8-684g (CVE-2025-54365) and the unbounded-quantifier remediation of GHSA-j47q-rc62-w448 (CVE-2025-53539) for every stock pattern, despite the changelog advertising \"Safe regex execution with configurable timeouts to prevent ReDoS attacks.\"\n\n### Details\n\n**1. The pattern** — `guard_core/handlers/suspatterns_handler.py:519` (master `08780f1`), the built-in template-injection detector:\n\n```python\nr\"\\{\\{\\s*[^\\}]+(?:system|exec|popen|eval|require|include)\\s*\\}\\}\"\n```\n\nOn an input of `{` repeated N times, every one of the N−1 positions starts a `\\{\\{` match attempt and `[^\\}]+` scans to end-of-string and backtracks once per position → O(N²). Note the sibling pattern at `:524` (`\\{\\%\\s*[^\\%]+...`) is **not** vulnerable — its delimiter `%` is excluded from the character class, keeping scans bounded — which confirms the root cause is the unbounded, non-excluding `[^\\}]+`.\n\n**2. The unprotected execution path** — `guard_core/handlers/suspatterns_handler.py:910-926`:\n\n```python\nif compiler:\n    if category == \"custom\":\n        safe_matcher = compiler.create_safe_matcher(pattern)   # executor + timeout\n        match = safe_matcher(content)\n        ...\n    else:\n        match = pattern.search(content)                        # ← inline, NO timeout\n```\n\nIn enhanced mode (the default whenever a `SecurityConfig` is present — `_supports_enhanced_config()` is a duck-type attribute check a stock config always passes), all built-in patterns execute inline **inside the async coroutine**, blocking the event loop for the full scan. In guard-core ≤ 3.4.0, `_check_regex_pattern()` routed *every* pattern through `self._compiler.create_safe_matcher(pattern.pattern)` (verified in the 3.4.0 wheel, `suspatterns_handler.py:565-567`) or, without a compiler, through `_check_pattern_with_timeout` (4-worker pool + per-pattern timeout). The `category == \"custom\"` exemption appeared in 3.5.0.\n\n**3. Default reachability** — penetration detection is on by default (`enable_penetration_detection=True`), query parameters are scanned by default (`guard_core/utils.py:843-865`), and the default scan windo\n\nAffected packages: pip:guard-core\nPatched: guard-core 3.13.0","url":"https://github.com/advisories/GHSA-r7hm-rjvg-xx7j","published_at":"2026-11-19T22:49:33Z","updated_at":"2026-11-19T22:49:34Z","fetched_at":"2026-11-21T19:15:18.416785Z","severity":"high","cvss_score":7.8,"epss":0.00871,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"guard-core","vuln_id":"CVE-2026-129302","vuln_ids":["CVE-2025-53539","CVE-2025-54365","CVE-2026-129302","GHSA-J47Q-RC62-W448","GHSA-R7HM-RJVG-XX7J","GHSA-RRF6-PXG8-684G"],"tags":["ghsa","pip","CWE-400","CWE-1333"],"cluster_id":2167,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2370","html":"https://vulnwatch.ve1ve2.com/item/2370"}},{"id":6257,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-129302: Guard Core is an API security core engine for the FastAPI-Guard, FlaskAPI Guard, and DjAPI Guard adapters. From 3.5.0 until 3.13.0, built-in penetration-detect…","summary":"Guard Core is an API security core engine for the FastAPI-Guard, FlaskAPI Guard, and DjAPI Guard adapters. From 3.5.0 until 3.13.0, built-in penetration-detection patterns in guard_core/handlers/suspatterns_handler.py execute through a direct pattern.search(content) call instead of the timeout-protected create_safe_matcher() path used for custom patterns. The built-in template-injection detector contains an unbounded expression with quadratic behavior when scanning repeated opening braces. Because penetration detection and enhanced mode are enabled by a stock SecurityConfig, an unauthenticated request can block the shared asyncio event loop, affecting all application endpoints. The triggering input does not produce a detection match, so the request can complete without incrementing ban counters or being recorded as suspicious. This issue is fixed in version 3.13.0.\n\nReferences:\nhttps://github.com/Guard-Core/guard-core/commit/c07239fa1c5aa93e3f179440e79dad652977d3e4\nhttps://github.com/Guard-Core/guard-core/pull/68\nhttps://github.com/Guard-Core/guard-core/releases/tag/3.13.0\nhttps://github.com/Guard-Core/guard-core/security/advisories/GHSA-r7hm-rjvg-xx7j\nhttps://github.com/Guard-Core/guard-core/security/advisories/GHSA-r7hm-rjvg-xx7j","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129302","published_at":"2026-11-16T20:19:01.030000Z","updated_at":"2026-11-18T16:18:10.953000Z","fetched_at":"2026-11-21T19:15:31.482031Z","severity":"high","cvss_score":7.5,"epss":0.00527,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-129302","vuln_ids":["CVE-2025-53539","CVE-2025-54365","CVE-2026-129302","GHSA-J47Q-RC62-W448","GHSA-R7HM-RJVG-XX7J","GHSA-RRF6-PXG8-684G"],"tags":["CWE-400","CWE-1333"],"cluster_id":2168,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6257","html":"https://vulnwatch.ve1ve2.com/item/6257"}}]}