fix: P0 multipart parser bypass and fail-closed baseline configuration #163
All Vouch review confidence checks passed
Residual risk 0.27 = Change Risk (0.69) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.69 · 451 lines diff across 5 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.366
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.069
Real PR Conversation Timeline
1 comments
"Review active on #163"
general
weight: 0.35
redhat-chai-bot
P0: Multipart parser bypass + fail-closed baseline
Two critical safety gaps found during a differential parity analysis of
corazawaf/coraza(Go) vscoraza-rs(Rust). These combine into a confirmed WAF bypass: a valid multipart request silently stops Rust inspection while Go blocks it.CRIT-1 — Multipart parser bypass (commit 654f89a)
A multipart part with an empty header block (valid per RFC 2046, accepted by Go's
mime/multipart) causes the Rust parser to error out with "malformed MIME header: no blank line after headers" and stop inspecting all subsequent parts. A SQLi field placed after such a part is blocked by Go Coraza (rule 949110) and allowed by coraza-rs.Root cause:
find_header_endonly recognized\r\n\r\n/\r\n\n/\n\r\n/\n\nas header terminators. Data starting with\r\nor\n(empty header block) never matched.Fix:
find_header_endnow treats data starting with\r\nor\nas an empty header block. Two prefix checks before the existing scan — no loop or allocation overhead. All three callers go through this path, so they agree on where part data starts.CRIT-2 — No fail-closed baseline configuration (commit 23a3fad)
Neither envoy-coraza build (default nor CRS) ships the equivalent of Go's
coraza.conf-recommended. This means:REQBODY_ERROR,MULTIPART_STRICT_ERROR,URI_PARSE_ERROR) are absent — body parse errors are silently ignored+jsoncontent typesFix: Ships a
coraza.conf-recommendedequivalent embedded in both envoy-coraza builds. Rules 200000–200006 and 200009 are included. Policy documentation updated with recommended SecLang configuration.Connector fix (commit 2bb49df)
envoy-libperfusion connector test pinning empty-header multipart behavior, ensuring the parser fix is exercised through the connector path.
Verification
Changes
21 files changed, +1,512 / -46 lines
---
AI-generated. Review for accuracy.
@rikatz requested from Slack
Chai persona:
AI Gateway Engineer<!-- This is an auto-generated comment: release notes by coderabbit.ai -->
<!-- coderabbit-ai-generated:v1 -->
Summary by CodeRabbit
New Features
Added a built-in recommended security configuration to every build, with request and response inspection, parsing limits, and fail-closed handling for selected errors. It can be loaded explicitly before rule sets.
Updated examples to show the recommended configuration used with the rule engine and, where enabled, OWASP CRS.
Bug Fixes
Improved handling of multipart form parts with empty headers, preserving later fields for inspection. Malformed or unterminated multipart requests are handled according to the configured blocking policy.
Documentation
* Expanded guidance on configuration behavior, overrides, resource requirements, and security checks.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->