Skip to content

Fix checked parsing for argument and JSON depth limits - #3602

Open
AnnoyingTechnology wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
AnnoyingTechnology:contribute-back/checked-limit-parser
Open

Fix checked parsing for argument and JSON depth limits#3602
AnnoyingTechnology wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
AnnoyingTechnology:contribute-back/checked-limit-parser

Conversation

@AnnoyingTechnology

@AnnoyingTechnology AnnoyingTechnology commented Jul 23, 2026

Copy link
Copy Markdown

I have excess 5.6-sol and Fable 5 credits, and decided to use them to contribute back to OSS that I depend upon.

gpt5.6-sol cross-checked by Opus 4.8. Fable 5 could not cross-check due to safeties being triggered.

what

  • Parse SecArgumentsLimit through its existing checked
    ConfigUnsignedInt wrapper.
  • Do the same for SecRequestBodyJsonDepthLimit.
  • Return directive-specific configuration errors for values outside the
    wrapper's range.
  • Add regressions for the uint32_t maximum, 2^32, and decimals wider than
    uint64_t.
  • Register the new regression fixture in the standard make check suite.

why

PR #3421 converted these fields to checked unsigned wrappers so out-of-range
configuration would fail during startup, but these two grammar productions
still assigned atoi(...) directly.

On the tested platform, 4294967296 wrapped to zero. A zero
SecArgumentsLimit skipped every request argument, while a zero
SecRequestBodyJsonDepthLimit prevented the top-level JSON argument from being
exposed. The new code uses the same checked parsing pattern as the adjacent
body, PCRE, and upload limits.

This is configuration validation for trusted directives, not a remotely
triggerable vulnerability claim.

validation

  • New regression: 6 passed, 0 failed.
  • Existing SecArgumentsLimit regression: 2 passed, 0 failed.
  • Existing JSON parser regression: 6 passed, 0 failed.
  • Full make check: 5,049 total; 4,997 passed; 52 skipped; 0 failed.
  • git diff --check: pass.
  • Test JSON parsed with jq: pass.

Base: v3/master at
7ea9fefbe0ba409d8733b4d682c8c4c059cd028d.

references

@sonarqubecloud

Copy link
Copy Markdown

@airween airween added the 3.x Related to ModSecurity version 3.x label Jul 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Related to ModSecurity version 3.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants