owasp-modsecurity / owasp-modsecurity/ModSecurity
Proposal to enforce requestBodyProcessor=URLENCODED via recommended rules
@zimmerle is already working on this.
Since Jun 22, 2018.
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.8k
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 1
Description
The bypass is obvious. An attacker omits the content-type header, ModSec does not know which request body processor to use, the attack goes undetected, the backend makes a guess what to do with the request body and bingo.
The upcoming CRS 3.1 includes an optional rule to enforce URLENCODED when no body processor is set:
# Force body processor URLENCODED
SecRule TX:enforce_bodyproc_urlencoded "@eq 1" \
"id:901350,\
phase:1,\
pass,\
t:none,t:urlDecodeUni,\
nolog,\
noauditlog,\
msg:'Enabling forced body inspection for ASCII content',\
rev:'1',\
ver:'OWASP_CRS/3.1.0',\
chain"
SecRule REQBODY_PROCESSOR "!@rx (?:URLENCODED|MULTIPART|XML|JSON)" \
"ctl:requestBodyProcessor=URLENCODED"
However, this brings a behaviour change of the engine. And we would rather avoid that with CRS. Ideally this would be part of the recommended rules. It does not matter too much to us if it is enable by default or optional. But it would be helpful if we could refer to this rule in our documentation.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.