GHSA-3c6w-j9xm-8h2h: Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion
(updated )
The JSON response body processor parses response bodies with no recursion
limit. ProcessResponse calls readJSON(ss, ignoreJSONRecursionLimit), and
that constant is -1. The guard in readItems only fires on == 0, so
counting down from -1 (-2, -3, …) never reaches it. The guard is effectively
dead on the response path. The request path is fine: ProcessRequest passes the
configured limit (default 1024). There is no equivalent directive or default for
responses.
Parsing a deeply nested JSON response is CPU-bound and its cost grows
quadratically with nesting depth. A 512 KiB response (the default
ResponseBodyLimit) holds about 87,000 nesting levels and takes ~12 s to
process, keeping one core busy the whole time.
References
Code Behaviors & Features
Detect and mitigate GHSA-3c6w-j9xm-8h2h with GitLab Dependency Scanning
Secure your software supply chain by verifying that all open source dependencies used in your projects contain no disclosed vulnerabilities. Dependency Scanning using SBOM also detects vulnerabilities from proprietary advisories that this site does not include. Learn more about Dependency Scanning using SBOM →