owasp-modsecurity / owasp-modsecurity/ModSecurity

SecRuleUpdateActionById may not replace non-disruptive, non-additive actions

Open
#2,928 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.x
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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.