owasp-modsecurity / owasp-modsecurity/ModSecurity
SecRuleUpdateActionById may not replace non-disruptive, non-additive actions
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 9.8k
- Forks
- 1.8k
- Avg merge
- 2h 46m
- Merged PRs (30d)
- 1
Description
SecRuleUpdateActionById can successfully be used to:
- add actions where multiple of the same action is allowed in a rule (e.g. setvar)
- overwrite disruptive actions (e.g. change 'deny' to 'pass')
- add a non-disruptive, non-additive action when that action did not already exist in the rule
However, existing actions that are neither a replacement for a 'disruptive' action nor additive to previous actions do not get replaced as expected. E.g. with:
#SecRule ARGS "@rx 000" "id:98001,phase:2,deny,status:403,msg:'abc'"
#SecRuleUpdateActionById 98001 "msg:'def'"
... the msg content 'abc' is what will appear in the audit log.
In ModSecurity v2, the substitute text ('def') would appear in the log.
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.
Research direction
Start by tracing the SecRuleUpdateActionById implementation and the handling of existing non-disruptive, non-additive actions. Reproduce the issue with the provided SecRule and SecRuleUpdateActionById configuration, then verify that the audit log uses 'def' instead of 'abc', matching ModSecurity v2 behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100