Skip to content
Heist/ feed
Back to feed
MediumFix available

Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion

Type: advisorySources: OSV2 source records

### Summary 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. ### Root cause `internal/bodyprocessors/json.go` ```go const ignoreJSONRecursionLimit = -1 // line 51 func (js *jsonBodyProcessor) ProcessResponse(reader io.Reader, v ..., _ plugintypes.BodyProcessorOptions) error { ... data, err := readJSON(ss, ignoreJSONRecursionLimit) // line 62, passes -1 } func (js *jsonBodyProcessor) ProcessRequest(...) error { ... data, err := readJSON(ss, bpo.RequestBodyRecursionLimit) // line 32, default 1024 } ``` The guard and the decrement: ```go func readItems(json gjson.Result, objKey []byte, maxRecursion int, res map[string]string) error { if maxRecursion == 0 { // line 106 return errors.New("max recursion reached while reading json object") } ... iterationError = readItems(value, objKey, maxRecursion-1, res) //

Products
github.com/corazawaf/coraza, github.com/corazawaf/coraza/v2, github.com/corazawaf/coraza/v3
Affected versions
Not specified
Fixed versions
3.8.0
CVEs
CVE-2026-107833
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 08:43 UTC · Revision 2

Source evidence

Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion

core-osv · Original source

Published 8 Oct 2026, 17:51 UTC

### Summary 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. ### Root cause `internal/bodyprocessors/json.go` ```go const ignoreJSONRecursionLimit = -1 // line 51 func (js *jsonBodyProcessor) ProcessResponse(reader io.Reader, v ..., _ plugintypes.BodyProcessorOptions) error { ... data, err := readJSON(ss, ignoreJSONRecursionLimit) // line 62, passes -1 } func (js *jsonBodyProcessor) ProcessRequest(...) error { ... data, err := readJSON(ss, bpo.RequestBodyRecursionLimit) // line 32, default 1024 } ``` The guard and the decrement: ```go func readItems(json gjson.Result, objKey []byte, maxRecursion int, res map[string]string) error { if maxRecursion == 0 { // line 106 return errors.New("max recursion reached while reading json object") } ... iterationError = readItems(value, objKey, maxRecursion-1, res) //

osv:GHSA-3c6w-j9xm-8h2h

github.com/corazawaf/coraza/v3

Fixed versions: 3.8.0

Complete source record
{
  "id": "e42a443621b791dd78cfc21c1bd117f1e5f74d2252d3ab1455a6b221cdbaa502",
  "url": "https://osv.dev/vulnerability/GHSA-3c6w-j9xm-8h2h",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion",
    "summary": "### Summary 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. ### Root cause `internal/bodyprocessors/json.go` ```go const ignoreJSONRecursionLimit = -1 // line 51 func (js *jsonBodyProcessor) ProcessResponse(reader io.Reader, v ..., _ plugintypes.BodyProcessorOptions) error { ... data, err := readJSON(ss, ignoreJSONRecursionLimit) // line 62, passes -1 } func (js *jsonBodyProcessor) ProcessRequest(...) error { ... data, err := readJSON(ss, bpo.RequestBodyRecursionLimit) // line 32, default 1024 } ``` The guard and the decrement: ```go func readItems(json gjson.Result, objKey []byte, maxRecursion int, res map[string]string) error { if maxRecursion == 0 { // line 106 return errors.New(\"max recursion reached while reading json object\") } ... iterationError = readItems(value, objKey, maxRecursion-1, res) //",
    "evidence": "osv:GHSA-3c6w-j9xm-8h2h",
    "products": [
      {
        "name": {
          "value": "github.com/corazawaf/coraza/v3",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.8.0",
            "evidence": "/affected/0/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "medium",
    "structured": {
      "id": "GHSA-3c6w-j9xm-8h2h",
      "aliases": [
        "CVE-2026-107833",
        "GHSA-3c6w-j9xm-8h2h",
        "GO-2026-6690"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:N/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "3.0.0"
                },
                {
                  "fixed": "3.8.0"
                }
              ]
            }
          ],
          "package": {
            "name": "github.com/corazawaf/coraza/v3",
            "purl": "pkg:golang/github.com/corazawaf/coraza/v3",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/10/GHSA-3c6w-j9xm-8h2h/GHSA-3c6w-j9xm-8h2h.json"
          }
        }
      ],
      "modified": "2026-10-19T21:40:39.936037347Z",
      "provider": "osv",
      "references": [
        "https://github.com/corazawaf/coraza/security/advisories/GHSA-3c6w-j9xm-8h2h",
        "https://github.com/corazawaf/coraza/commit/cae3c7407e7b84372c207033de03f15f89bf351a",
        "https://github.com/corazawaf/coraza",
        "https://github.com/corazawaf/coraza/releases/tag/v3.8.0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-674"
        ],
        "severity": "MODERATE",
        "github_reviewed": true,
        "nvd_published_at": null,
        "github_reviewed_at": "2026-10-08T17:51:42Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-107833",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 376724,
  "published_at": "2026-10-08T17:51:42+00:00"
}

Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion in github.com/corazawaf/coraza

core-osv · Original source

Published 19 Oct 2026, 21:08 UTC

Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion in github.com/corazawaf/coraza

osv:GO-2026-6690

github.com/corazawaf/coraza

Fixed versions: Not specified

github.com/corazawaf/coraza/v2

Fixed versions: Not specified

github.com/corazawaf/coraza/v3

Fixed versions: 3.8.0

Complete source record
{
  "id": "bec6d95c4cdfaa2e1e8e71b5007c130eef5ccb13bc508684d66323c43b930b36",
  "url": "https://osv.dev/vulnerability/GO-2026-6690",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion in github.com/corazawaf/coraza",
    "summary": "Coraza: Unbounded recursion in JSON response body processor causes CPU exhaustion in github.com/corazawaf/coraza",
    "evidence": "osv:GO-2026-6690",
    "products": [
      {
        "name": {
          "value": "github.com/corazawaf/coraza",
          "evidence": "/affected/0/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": []
      },
      {
        "name": {
          "value": "github.com/corazawaf/coraza/v2",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [],
        "affected_versions": []
      },
      {
        "name": {
          "value": "github.com/corazawaf/coraza/v3",
          "evidence": "/affected/2/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "3.8.0",
            "evidence": "/affected/2/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "GO-2026-6690",
      "aliases": [
        "CVE-2026-107833",
        "GHSA-3c6w-j9xm-8h2h",
        "GO-2026-6690"
      ],
      "affected": [
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "github.com/corazawaf/coraza",
            "purl": "pkg:golang/github.com/corazawaf/coraza",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://vuln.go.dev/ID/GO-2026-6690.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "0"
                }
              ]
            }
          ],
          "package": {
            "name": "github.com/corazawaf/coraza/v2",
            "purl": "pkg:golang/github.com/corazawaf/coraza/v2",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://vuln.go.dev/ID/GO-2026-6690.json"
          },
          "ecosystem_specific": {}
        },
        {
          "ranges": [
            {
              "type": "SEMVER",
              "events": [
                {
                  "introduced": "3.0.0"
                },
                {
                  "fixed": "3.8.0"
                }
              ]
            }
          ],
          "package": {
            "name": "github.com/corazawaf/coraza/v3",
            "purl": "pkg:golang/github.com/corazawaf/coraza/v3",
            "ecosystem": "Go"
          },
          "database_specific": {
            "source": "https://vuln.go.dev/ID/GO-2026-6690.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-19T21:40:39.936037347Z",
      "provider": "osv",
      "references": [
        "https://github.com/corazawaf/coraza/security/advisories/GHSA-3c6w-j9xm-8h2h",
        "https://github.com/corazawaf/coraza/commit/cae3c7407e7b84372c207033de03f15f89bf351a",
        "https://github.com/corazawaf/coraza/releases/tag/v3.8.0"
      ],
      "provider_metadata": {
        "url": "https://pkg.go.dev/vuln/GO-2026-6690",
        "review_status": "UNREVIEWED"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-107833",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 376725,
  "published_at": "2026-10-19T21:08:17+00:00"
}