Skip to content
Heist/ feed
Back to feed
MediumFix available

Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields

Type: advisorySources: OSV2 source records

## Root Cause File: `internal/auditlog/formats.go` — multiple sites write attacker-influenced bytes into the Native audit-log stream without escaping `\r` or `\n`: ```go // Part B — request headers (lines 72–80) for k, vv := range al.Transaction().Request().Headers() { for _, v := range vv { res.WriteByte('\n') res.WriteString(k) res.WriteString(": ") res.WriteString(v) // ← raw } } // Part C — request body (lines 85–86) if body := al.Transaction().Request().Body(); body != "" { res.WriteString(body) // ← raw res.WriteByte('\n') } // Part E — response body (lines 93–94) raw // Part F — response headers (lines 111–118) raw // Part H — error messages (line 125) raw // Part K — matched-rule raw data (line 151) raw ``` The Native format's section structure is line-based: sections are delimited by lines of the form `--<10-char-random-prefix>---`, and line-based log parsers / SIEM rules rely on that structure. Any attacker-controlled bytes containing `\n` break the structural invariant and allow the attacker to inject lines that look like genuine audit content. The other two Native-format implementations in Coraza are not affected: the JSON formatter (`formats_json.go`) and the OCSF formatter both round-trip values through `json.Marshal`, which escapes `\r` and `\n`. ## Impact An attacker who can land bytes into any of the listed audit-log fields can inject arbitrary lines — including lines that visually resemble new log entries — into the audit log file of a defender running the d

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-41504
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 08:45 UTC · Revision 1

Source evidence

Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields

core-osv · Original source

Published 6 Oct 2026, 20:37 UTC

## Root Cause File: `internal/auditlog/formats.go` — multiple sites write attacker-influenced bytes into the Native audit-log stream without escaping `\r` or `\n`: ```go // Part B — request headers (lines 72–80) for k, vv := range al.Transaction().Request().Headers() { for _, v := range vv { res.WriteByte('\n') res.WriteString(k) res.WriteString(": ") res.WriteString(v) // ← raw } } // Part C — request body (lines 85–86) if body := al.Transaction().Request().Body(); body != "" { res.WriteString(body) // ← raw res.WriteByte('\n') } // Part E — response body (lines 93–94) raw // Part F — response headers (lines 111–118) raw // Part H — error messages (line 125) raw // Part K — matched-rule raw data (line 151) raw ``` The Native format's section structure is line-based: sections are delimited by lines of the form `--<10-char-random-prefix>---`, and line-based log parsers / SIEM rules rely on that structure. Any attacker-controlled bytes containing `\n` break the structural invariant and allow the attacker to inject lines that look like genuine audit content. The other two Native-format implementations in Coraza are not affected: the JSON formatter (`formats_json.go`) and the OCSF formatter both round-trip values through `json.Marshal`, which escapes `\r` and `\n`. ## Impact An attacker who can land bytes into any of the listed audit-log fields can inject arbitrary lines — including lines that visually resemble new log entries — into the audit log file of a defender running the d

osv:GHSA-prpw-wwv7-xjjr

github.com/corazawaf/coraza/v3

Fixed versions: 3.8.0

Complete source record
{
  "id": "a41753fc503a75667cd5631943b8763c98dac04590185143ef847177fc9e4910",
  "url": "https://osv.dev/vulnerability/GHSA-prpw-wwv7-xjjr",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields",
    "summary": "## Root Cause File: `internal/auditlog/formats.go` — multiple sites write attacker-influenced bytes into the Native audit-log stream without escaping `\\r` or `\\n`: ```go // Part B — request headers (lines 72–80) for k, vv := range al.Transaction().Request().Headers() { for _, v := range vv { res.WriteByte('\\n') res.WriteString(k) res.WriteString(\": \") res.WriteString(v) // ← raw } } // Part C — request body (lines 85–86) if body := al.Transaction().Request().Body(); body != \"\" { res.WriteString(body) // ← raw res.WriteByte('\\n') } // Part E — response body (lines 93–94) raw // Part F — response headers (lines 111–118) raw // Part H — error messages (line 125) raw // Part K — matched-rule raw data (line 151) raw ``` The Native format's section structure is line-based: sections are delimited by lines of the form `--<10-char-random-prefix>---`, and line-based log parsers / SIEM rules rely on that structure. Any attacker-controlled bytes containing `\\n` break the structural invariant and allow the attacker to inject lines that look like genuine audit content. The other two Native-format implementations in Coraza are not affected: the JSON formatter (`formats_json.go`) and the OCSF formatter both round-trip values through `json.Marshal`, which escapes `\\r` and `\\n`. ## Impact An attacker who can land bytes into any of the listed audit-log fields can inject arbitrary lines — including lines that visually resemble new log entries — into the audit log file of a defender running the d",
    "evidence": "osv:GHSA-prpw-wwv7-xjjr",
    "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-prpw-wwv7-xjjr",
      "aliases": [
        "CVE-2026-41504",
        "GHSA-prpw-wwv7-xjjr",
        "GO-2026-6669"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:N/I:L/A:N"
        }
      ],
      "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-prpw-wwv7-xjjr/GHSA-prpw-wwv7-xjjr.json",
            "last_known_affected_version_range": "<= 3.7.0"
          }
        }
      ],
      "modified": "2026-10-20T00:40:33.971199199Z",
      "provider": "osv",
      "references": [
        "https://github.com/corazawaf/coraza/security/advisories/GHSA-prpw-wwv7-xjjr",
        "https://github.com/corazawaf/coraza/commit/a3079325547c7c1e08522aed4d6468f25d080e25",
        "https://github.com/corazawaf/coraza",
        "https://github.com/corazawaf/coraza/releases/tag/v3.8.0"
      ],
      "provider_metadata": {
        "cwe_ids": [
          "CWE-117",
          "CWE-93"
        ],
        "severity": "MODERATE",
        "github_reviewed": true,
        "nvd_published_at": null,
        "github_reviewed_at": "2026-10-06T20:37:27Z"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-41504",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 376860,
  "published_at": "2026-10-06T20:37:27+00:00"
}

Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields in github.com/corazawaf/coraza

core-osv · Original source

Published 20 Oct 2026, 00:20 UTC

Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields in github.com/corazawaf/coraza

osv:GO-2026-6669

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": "3ae3f757599ce51d285c79bff67297dde9341af4b7e7849fd8d0b7538bd7e3db",
  "url": "https://osv.dev/vulnerability/GO-2026-6669",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields in github.com/corazawaf/coraza",
    "summary": "Coraza: Native audit-log format allows CRLF injection and log forgery via request body and header fields in github.com/corazawaf/coraza",
    "evidence": "osv:GO-2026-6669",
    "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-6669",
      "aliases": [
        "CVE-2026-41504",
        "GHSA-prpw-wwv7-xjjr",
        "GO-2026-6669"
      ],
      "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-6669.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-6669.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-6669.json"
          },
          "ecosystem_specific": {}
        }
      ],
      "modified": "2026-10-20T00:30:05.355003525Z",
      "provider": "osv",
      "references": [
        "https://github.com/corazawaf/coraza/security/advisories/GHSA-prpw-wwv7-xjjr",
        "https://github.com/corazawaf/coraza/commit/a3079325547c7c1e08522aed4d6468f25d080e25",
        "https://github.com/corazawaf/coraza/releases/tag/v3.8.0"
      ],
      "provider_metadata": {
        "url": "https://pkg.go.dev/vuln/GO-2026-6669",
        "review_status": "UNREVIEWED"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2026-41504",
        "evidence": "/aliases"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 376858,
  "published_at": "2026-10-20T00:20:51+00:00"
}