coraza-spoa: Coraza v3.8.1 security update (RC build only), SecArgumentsLimit 65536 #27

Open
jknapp wants to merge 1 commits from coraza-release/3.8.1 into main
pull from: coraza-release/3.8.1
Owner

What

Security update of the coraza-spoa WAF engine to Coraza v3.8.1, built as a release candidate only. Do not merge (2026.11.87 merge freeze; an independent adversarial review follows). Merging moves :latest, and apply-coraza-waf-mode.sh pulls :latest on every unpinned host. Merge only after the staged rollout below.

  • Dockerfile: coraza-spoa stays on v0.7.1 and CRS stays on coraza-coreruleset v4.25.0. Only the engine changes, upgraded in place with ARG CORAZA_VERSION=v3.8.1 and go get, verified against go.sum / sum.golang.org. The build fails unless go version -m shows exactly that version in the binary. I chose this over coraza-spoa v0.9.1, which also pins 3.8.1, because v0.9.1 also brings haproxy-go 0.1.1 and SPOA changes the WHP regression net does not measure.
  • config.yaml: adds SecArgumentsLimit 65536 plus the dropped-arguments guard 209620/209621. Details are below.
  • Workflow: a push to coraza-release/** publishes only :<coraza-spoa/VERSION>-rc and :<sha>, never :latest. I did not use release/** because that prefix also triggers build-push.yaml, which would re-publish the edge's :<VERSION>-rc tag. main publishes :latest, :<version> and :<sha>. The new coraza-spoa/VERSION is 2026.11.1.
  • README: documents the engine pin and the release-candidate flow.

Why (advisories that bypass rules WHP enforces, reproduced on v3.7.0)

Advisory Effect on 3.7.0 in WHP's regression net
GHSA-pc5q-qfxp-ggqv (jsDecode octal) Log4Shell written as \44\173jndi:...\175 is not seen by the enforced rule 944150. XSS and Node RCE in octal escapes are not scored.
GHSA-5gj4-9gm7-2fx2 (JSON key collision) An LFI in {"a.b":..} that is shadowed by a later {"a":{"b":..}}, or by a case or duplicate collision, is not seen by the enforced rule 930120.
GHSA-x26q-wvhg-fh4m (ProcessURI) A raw 0x7f in the query drops all ARGS_GET, so a query LFI is not seen by 930120.
GHSA-w253-m66g-rx24 (Content-Type desync) The last Content-Type header picks the body processor, not the one PHP uses.

Not applicable to us:

  • GHSA-3c6w-j9xm-8h2h (JSON response recursion DoS): response_check: false.
  • Native audit-log CRLF: we use the JSON format.

The multipart advisories (truncated body / 200003, file-handle accumulation, filename*) are fixed by the engine bump too.

The 3.8 regression this PR also fixes: SecArgumentsLimit

Coraza 3.8 enforces SecArgumentsLimit (default 1000) on urlencoded/JSON bodies and on the query string. It stops parsing at the limit and never inspects anything after it.

  • Measured: "1000 filler args + LFI in arg 1001" is blocked on 3.7.0 but was not inspected at all on 3.8.1 with the default.
  • Why upstream's fix doesn't reach us: upstream pairs the cap with deny rules 200004/200005 in its own coraza.conf-recommended. The @coraza.conf-recommended we Include is the one embedded in coraza-coreruleset v4.25.0, and it predates them.
  • Fix: SecArgumentsLimit 65536, which is SecRequestBodyLimit / 2. A pair is at least 2 bytes (a&), so no accepted body can reach the limit, and every argument is inspected as on 3.7. Memory stays bounded by the body limit.
  • Defense in depth: if arguments were ever dropped, 209620/209621 deny in enforce mode and log in detect_only. This uses the same two-rule shape as WHP's JSON guard 991900030/031, placed before CRS. ARGUMENTS_LIMIT_REACHED only exists on 3.8, which is why the guard lives in the image.
  • Verified with the limit temporarily lowered to 1000: enforce is interrupted by 209621 with a 400, and detect_only only logs.

Tests

  • Local build: docker build coraza-spoa succeeds (amd64). The version gate passes, and the container starts on the new config with no rule-load error. This was a local test container only, not on any host.
  • Python tests:
    • scripts/test-assemble-multiarch-index.py: 12 OK (WorkflowWiring included)
    • scripts/test-waf-body-inspection.py: 28 OK
    • scripts/test-multipart-cve-mitigation.py: 6 OK
  • WHP WAF regression net (companion WHP PR, coraza v3.8.1 plus this config block mirrored):
    • 1206 rows, 0 FAIL, RESULT OK.
    • Adds 11 advisory cases. 8 fail on 3.7.0. The other 3 are parity cases (both arg floods and the charset case) that pass on both versions and guard the upgrade.

Staged rollout (after review; nothing has been rolled out)

The release-candidate image is pinned per host through WHP's coraza image pin (/etc/whp/coraza-image, WHP PR) and applied with container-manager.sh recreate coraza-spoa. The order is canary, then whp03, whp01, sdbees, TrueSelfCA, and whp02. Merge here (which moves :latest) only after all hosts are verified.

🤖 Generated with Claude Code

https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6

## What Security update of the coraza-spoa WAF engine to **Coraza v3.8.1**, built as a release candidate only. **Do not merge** (2026.11.87 merge freeze; an independent adversarial review follows). Merging moves `:latest`, and `apply-coraza-waf-mode.sh` pulls `:latest` on every unpinned host. Merge only after the staged rollout below. - **Dockerfile:** coraza-spoa stays on `v0.7.1` and CRS stays on coraza-coreruleset `v4.25.0`. Only the engine changes, upgraded in place with `ARG CORAZA_VERSION=v3.8.1` and `go get`, verified against go.sum / sum.golang.org. The build fails unless `go version -m` shows exactly that version in the binary. I chose this over coraza-spoa v0.9.1, which also pins 3.8.1, because v0.9.1 also brings haproxy-go 0.1.1 and SPOA changes the WHP regression net does not measure. - **config.yaml:** adds `SecArgumentsLimit 65536` plus the dropped-arguments guard `209620`/`209621`. Details are below. - **Workflow:** a push to `coraza-release/**` publishes **only** `:<coraza-spoa/VERSION>-rc` and `:<sha>`, never `:latest`. I did not use `release/**` because that prefix also triggers `build-push.yaml`, which would re-publish the edge's `:<VERSION>-rc` tag. `main` publishes `:latest`, `:<version>` and `:<sha>`. The new `coraza-spoa/VERSION` is `2026.11.1`. - **README:** documents the engine pin and the release-candidate flow. ## Why (advisories that bypass rules WHP enforces, reproduced on v3.7.0) | Advisory | Effect on 3.7.0 in WHP's regression net | |---|---| | GHSA-pc5q-qfxp-ggqv (jsDecode octal) | Log4Shell written as `\44\173jndi:...\175` is not seen by the enforced rule 944150. XSS and Node RCE in octal escapes are not scored. | | GHSA-5gj4-9gm7-2fx2 (JSON key collision) | An LFI in `{"a.b":..}` that is shadowed by a later `{"a":{"b":..}}`, or by a case or duplicate collision, is not seen by the enforced rule 930120. | | GHSA-x26q-wvhg-fh4m (ProcessURI) | A raw 0x7f in the query drops **all** ARGS_GET, so a query LFI is not seen by 930120. | | GHSA-w253-m66g-rx24 (Content-Type desync) | The last `Content-Type` header picks the body processor, not the one PHP uses. | Not applicable to us: - **GHSA-3c6w-j9xm-8h2h** (JSON response recursion DoS): `response_check: false`. - **Native audit-log CRLF:** we use the JSON format. The multipart advisories (truncated body / 200003, file-handle accumulation, `filename*`) are fixed by the engine bump too. ## The 3.8 regression this PR also fixes: `SecArgumentsLimit` Coraza 3.8 enforces `SecArgumentsLimit` (default 1000) on urlencoded/JSON bodies and on the query string. It stops parsing at the limit and **never inspects** anything after it. - **Measured:** "1000 filler args + LFI in arg 1001" is blocked on 3.7.0 but was not inspected at all on 3.8.1 with the default. - **Why upstream's fix doesn't reach us:** upstream pairs the cap with deny rules 200004/200005 in *its own* `coraza.conf-recommended`. The `@coraza.conf-recommended` we Include is the one embedded in coraza-coreruleset v4.25.0, and it predates them. - **Fix:** `SecArgumentsLimit 65536`, which is `SecRequestBodyLimit / 2`. A pair is at least 2 bytes (`a&`), so no accepted body can reach the limit, and every argument is inspected as on 3.7. Memory stays bounded by the body limit. - **Defense in depth:** if arguments were ever dropped, `209620`/`209621` deny in enforce mode and log in detect_only. This uses the same two-rule shape as WHP's JSON guard 991900030/031, placed before CRS. `ARGUMENTS_LIMIT_REACHED` only exists on 3.8, which is why the guard lives in the image. - **Verified** with the limit temporarily lowered to 1000: enforce is interrupted by 209621 with a 400, and detect_only only logs. ## Tests - **Local build:** `docker build coraza-spoa` succeeds (amd64). The version gate passes, and the container starts on the new config with no rule-load error. This was a local test container only, not on any host. - **Python tests:** - `scripts/test-assemble-multiarch-index.py`: 12 OK (WorkflowWiring included) - `scripts/test-waf-body-inspection.py`: 28 OK - `scripts/test-multipart-cve-mitigation.py`: 6 OK - **WHP WAF regression net** (companion WHP PR, coraza v3.8.1 plus this config block mirrored): - 1206 rows, 0 FAIL, RESULT OK. - Adds 11 advisory cases. 8 fail on 3.7.0. The other 3 are parity cases (both arg floods and the charset case) that pass on both versions and guard the upgrade. ## Staged rollout (after review; nothing has been rolled out) The release-candidate image is pinned per host through WHP's coraza image pin (`/etc/whp/coraza-image`, WHP PR) and applied with `container-manager.sh recreate coraza-spoa`. The order is canary, then whp03, whp01, sdbees, TrueSelfCA, and whp02. Merge here (which moves `:latest`) only after all hosts are verified. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
jknapp added 1 commit 2026-11-28 05:42:46 +00:00
coraza-spoa: Coraza engine v3.8.1 (security), SecArgumentsLimit 65536, RC-only publish branch
Build and push coraza-spoa / Build-and-Push (push) Successful in 5m42s
4a453df83e
Security update of the WAF engine. coraza-spoa v0.7.1 pins
github.com/corazawaf/coraza/v3 v3.7.0, which is affected by the v3.8.x
advisories; several are bypasses of rules WHP enforces, reproduced in WHP's
WAF regression net on v3.7.0:

- GHSA-pc5q-qfxp-ggqv jsDecode octal: Log4Shell with ${ } as \44\173 ... \175
  escapes is not seen by the enforced 944150.
- GHSA-5gj4-9gm7-2fx2 JSON key collision: LFI in {"a.b":..} shadowed by a
  later {"a":{"b":..}} (or a case/duplicate collision) is not seen by 930120.
- GHSA-x26q-wvhg-fh4m ProcessURI: a raw 0x7f in the query drops ALL ARGS_GET.
- GHSA-w253-m66g-rx24: the LAST Content-Type picked the body processor.

Dockerfile: keep coraza-spoa v0.7.1 and CRS (coraza-coreruleset v4.25.0)
unchanged; upgrade only the engine in place (ARG CORAZA_VERSION=v3.8.1,
go get, verified against go.sum/sum.golang.org). The build fails unless
`go version -m` shows exactly that version in the binary.

config.yaml: Coraza 3.8 enforces SecArgumentsLimit (default 1000) on
urlencoded/JSON bodies and the query string and never inspects arguments
past it. With the default, "1000 filler args + LFI in arg 1001" bypassed
930120 on 3.8.1 (it is blocked on 3.7.0). Upstream's mitigation (deny rules
200004/200005) is in Coraza's own coraza.conf-recommended, not in the one
coraza-coreruleset v4.25.0 embeds (the @coraza.conf-recommended we load).
Set SecArgumentsLimit 65536 (= SecRequestBodyLimit / 2: no accepted body can
reach it, so every argument is inspected as on 3.7) and add 209620/209621:
deny in enforce / log in detect_only if arguments were ever dropped
(ARGUMENTS_LIMIT_REACHED, 3.8-only variable, so it lives in the image).

Workflow: a push to coraza-release/** publishes ONLY :<coraza-spoa/VERSION>-rc
and :<sha> (never :latest), for a staged per-host rollout through WHP's coraza
image pin. Not release/**: that prefix also triggers the edge image build.
main keeps publishing :latest (+ :<version> + :<sha>). New coraza-spoa/VERSION
2026.11.1.

Do not merge until the staged rollout is done: merging moves :latest, which
apply-coraza-waf-mode.sh pulls on every unpinned host.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0185ukXi4YX5FxJGqhi6qab6
Author
Owner

Independent security review: HMB #27 (coraza-spoa on Coraza v3.8.1)

Verdict: no HIGH or MEDIUM defects in this PR, and I pushed nothing here. A push would rebuild and re-publish :2026.11.1-rc under a new digest. Keep it unmerged until the per-host rollout is done.

RC image verified against the source. I pulled index sha256:a47035f9…; it holds amd64 891fc8f2… and arm64 02f1d0d9…. The digests in the PR body, ea362c70… and 8faae340…, are the per-arch indexes that contain those.

  • go version -m on the extracted binary: coraza/v3 v3.8.1, coraza-coreruleset/v4 v4.25.0, haproxy-go v0.0.8, go1.25.14.
  • /etc/coraza-spoa/config.yaml and /etc/coraza/overrides.conf in the image are byte-identical to the branch.
  • The non-comment lines of overrides.conf equal WHP's baked/overrides.conf.

CI path:

  • coraza-release/** publishes only :<VERSION>-rc and :<sha>, and only to the coraza-spoa repo. Edge tags (the haproxy-manager-base repo) cannot be written.
  • build-push.yaml's release/** filter does not match coraza-release/….
  • The refuse-other-refs branch also closes an older gap: before this change, a workflow_dispatch from any branch published :latest.
  • :latest is still sha256:de311301….

SecArgumentsLimit 65536 and 209620/209621.

  • The limit is unreachable. HAProxy hands at most 16 KB of body, a pair is at least 2 bytes (empty keys are skipped; = counts), and the body limit is 131072.
  • With the limit temporarily lowered to 1000, 209621 denied in enforce and only logged in detect_only (WHP net). The rules sit in the engine range, so customer emergency mode removes them.
  • No false positive on large legitimate forms: a 1200-field bulk edit and a 600-field nav-menus save both pass.

LOW and INFO:

  • LOW: the build gate greps the dep line. It would not notice a replace (=>) of coraza, but there is none today (checked in the binary). Optional hardening for the next change.
  • LOW: the plain :<VERSION> tag is re-published by any later main push that touches coraza-spoa/** without a VERSION bump.
  • INFO: the pre-existing SPOE 100 ms fail-open for argument-heavy bodies is unchanged by this PR (same CPU as 3.7.0). Details are in the WHP #464 review.

Rollout plan: sound, with three additions.

  1. Pin by digest (…coraza-spoa@sha256:a47035f9…), never by the -rc tag.
  2. The soak must also watch 991900020 and 200003. 3.8 strict multipart can now deny non-browser uploads in enforce, for example an unquoted filename= containing a space. Also watch 209621, as already listed.
  3. Merging here does not publish the soaked image: CI rebuilds and :latest gets a new digest. Either keep the pins until that build is verified the same way (go version -m, config.yaml), or promote the soaked index by re-tagging instead of rebuilding.
Independent security review: HMB #27 (coraza-spoa on Coraza v3.8.1) **Verdict: no HIGH or MEDIUM defects in this PR, and I pushed nothing here. A push would rebuild and re-publish `:2026.11.1-rc` under a new digest. Keep it unmerged until the per-host rollout is done.** **RC image verified against the source.** I pulled index `sha256:a47035f9…`; it holds amd64 `891fc8f2…` and arm64 `02f1d0d9…`. The digests in the PR body, `ea362c70…` and `8faae340…`, are the per-arch indexes that contain those. - `go version -m` on the extracted binary: coraza/v3 **v3.8.1**, coraza-coreruleset/v4 **v4.25.0**, haproxy-go v0.0.8, go1.25.14. - `/etc/coraza-spoa/config.yaml` and `/etc/coraza/overrides.conf` in the image are byte-identical to the branch. - The non-comment lines of `overrides.conf` equal WHP's `baked/overrides.conf`. **CI path:** - `coraza-release/**` publishes only `:<VERSION>-rc` and `:<sha>`, and only to the `coraza-spoa` repo. Edge tags (the `haproxy-manager-base` repo) cannot be written. - `build-push.yaml`'s `release/**` filter does not match `coraza-release/…`. - The refuse-other-refs branch also closes an older gap: before this change, a `workflow_dispatch` from any branch published `:latest`. - `:latest` is still `sha256:de311301…`. **SecArgumentsLimit 65536 and 209620/209621.** - The limit is unreachable. HAProxy hands at most 16 KB of body, a pair is at least 2 bytes (empty keys are skipped; `=` counts), and the body limit is 131072. - With the limit temporarily lowered to 1000, 209621 denied in enforce and only logged in detect_only (WHP net). The rules sit in the engine range, so customer emergency mode removes them. - No false positive on large legitimate forms: a 1200-field bulk edit and a 600-field nav-menus save both pass. LOW and INFO: - **LOW:** the build gate greps the `dep` line. It would not notice a `replace` (`=>`) of coraza, but there is none today (checked in the binary). Optional hardening for the next change. - **LOW:** the plain `:<VERSION>` tag is re-published by any later `main` push that touches `coraza-spoa/**` without a VERSION bump. - **INFO:** the pre-existing SPOE 100 ms fail-open for argument-heavy bodies is unchanged by this PR (same CPU as 3.7.0). Details are in the WHP #464 review. **Rollout plan:** sound, with three additions. 1. Pin by digest (`…coraza-spoa@sha256:a47035f9…`), never by the `-rc` tag. 2. The soak must also watch **991900020** and 200003. 3.8 strict multipart can now deny non-browser uploads in enforce, for example an unquoted `filename=` containing a space. Also watch 209621, as already listed. 3. Merging here does **not** publish the soaked image: CI rebuilds and `:latest` gets a new digest. Either keep the pins until that build is verified the same way (`go version -m`, `config.yaml`), or promote the soaked index by re-tagging instead of rebuilding.
All checks were successful
Build and push coraza-spoa / Build-and-Push (push) Successful in 5m42s
You are not authorized to merge this pull request.
This pull request can be merged automatically.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin coraza-release/3.8.1:coraza-release/3.8.1
git checkout coraza-release/3.8.1
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: cloud-hosting-platform/haproxy-manager-base#27