Skip to content

deps: zentinel-modsec 0.2.0 -> 0.3.0 (JSON body inspection) - #6

Merged
raffaelschneider merged 1 commit into
mainfrom
deps/modsec-0.3.0
Aug 22, 2026
Merged

deps: zentinel-modsec 0.2.0 -> 0.3.0 (JSON body inspection)#6
raffaelschneider merged 1 commit into
mainfrom
deps/modsec-0.3.0

Conversation

@raffaelschneider

Copy link
Copy Markdown
Contributor

Picks up zentinel-modsec 0.3.0.

Why this one matters

Before 0.3.0, a JSON request body fell through to the urlencoded parser, which extracts nothing usable from it. ARGS was empty for every JSON request, so SecRule ARGS "@detectSQLi" — CRS 942100, the core SQLi rule — had nothing to inspect:

urlencoded body, SQLi in q  -> blocked=true
JSON body, SQLi in q        -> blocked=false

This agent sits in front of APIs that are overwhelmingly JSON. That was most of the traffic it exists to protect.

Also gained: per-transaction ctl: actions, so CRS exclusions written as ctl:ruleRemoveTargetById=942100;ARGS:json.token now actually apply; and unusable @rx patterns reported at load rather than silently never matching.

Why a minor version, not a patch

The engine went to 0.3.0 deliberately. This changes which requests are blocked in both directions, and the caret requirement on "0.2" would have picked up a patch release silently. For a WAF that is not a routine dependency bump.

Verification

tests/engine_behaviour.rs gains the JSON cases. That file exists because this crate's own tests cover its configuration and protocol surface but not blocking decisions — an engine bump could otherwise change security behaviour with nothing here to catch it.

Added: SQLi in a JSON body, the same payload in a form body as a control (without it, the JSON assertion would pass just as well against an engine that blocked everything), a nested object, clean JSON passing, and an empty JSON body not tripping a REQBODY_ERROR rule — routine on POST and DELETE, and a false positive if mishandled.

8 tests, full suite green, clippy and fmt clean.

For operators

Re-test your ruleset against representative traffic. JSON bodies are now inspected where they were not, so genuine detections will appear that did not before — along with any false positives your ruleset has for JSON traffic that were previously invisible because the body was never parsed.

Picks up JSON request body inspection (zentinel-modsec#24), which is the
reason this bump matters rather than being routine.

Before 0.3.0 a JSON body fell through to the urlencoded parser, so ARGS was
empty for every JSON request and `SecRule ARGS "@detectSQLi"` had nothing to
look at. This agent sits in front of APIs that are overwhelmingly JSON, so
that was most of the traffic it exists to protect.

Also gains per-transaction ctl: actions (#23) -- so CRS exclusions written as
`ctl:ruleRemoveTargetById=942100;ARGS:json.token` now apply -- and unusable
@rx patterns reported at load instead of silently never matching (#25).

The engine went to a minor version deliberately: this changes which requests
are blocked in both directions, and the caret requirement on "0.2" would have
picked up a patch silently.

Extends tests/engine_behaviour.rs with the JSON cases: SQLi in a JSON body,
the same payload in a form body as a control, a nested object, clean JSON
passing, and an empty JSON body not tripping a REQBODY_ERROR rule -- routine
on POST and DELETE, and a false positive if mishandled.

8 tests, full suite green, clippy and fmt clean.

Operators should re-test their ruleset against representative traffic: JSON
bodies are now inspected where they were not, so genuine detections will
appear that did not before, along with any false positives a ruleset has for
JSON traffic.
@raffaelschneider
raffaelschneider merged commit 9866159 into main Aug 22, 2026
3 checks passed
@raffaelschneider
raffaelschneider deleted the deps/modsec-0.3.0 branch August 31, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant