owasp-modsecurity / owasp-modsecurity/ModSecurity

Audit log match does not represent chained rules

Open
#3,569 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

3.x duplicate
Dominant language
C++
Stars
9.8k
Forks
1.8k
Avg merge
2h 46m
Merged PRs (30d)
1

Description

Hi,

When using chained rules, the match field only contains details about the last rule in the chain:

SecRule REQUEST_HEADERS:User-Agent "@contains curl" "id:1000,msg:'POST with cURL',auditlog,phase:1,deny,t:none,chain"
    SecRule REQUEST_METHOD "@rx POST" "t:none"

Trigger the rule:

curl -X POST http://localhost:8080/hello

Current log message:

Matched "Operator `Rx' with parameter `POST' against variable `REQUEST_METHOD' (Value: `POST' )

Expected log message:

Matched: "Operator `Contains' with parameter `curl' against variable `REQUEST_HEADERS:User-Agent' (Value: `curl/8.5.0' ), "Operator `Rx' with parameter `POST' against variable `REQUEST_METHOD' (Value: `POST' )

Currently, the audit log does not fully represent which conditions caused the chained rule to match.

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

Reproduce the chained SecRule with curl and compare the current and expected audit-log match messages. Trace the audit-log handling for chained rules and verify that the completed log represents every matched condition, including both the User-Agent and request-method checks.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.