owasp-modsecurity / owasp-modsecurity/ModSecurity

Log message should indicate if operator is negative

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

Nobody has claimed this yet.

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

Description

The rule:

SecRule ARGS:var "!@streq hello" "id:100,phase:1,deny,log"

Example of denied request:

curl http://localhost:8080/?var=hi

Log message:

Access denied with code 403 (phase 1). Matched "Operator `StrEq' with parameter `hello' against variable `ARGS:var' (Value: `hi' )

Reading the log message alone is confusing, why does @StrEq hello have a match for hi?


Also, I think the use of backticks (`) and single quotes (') in the log message should be fixed.

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 reported rule and request with the provided curl command, then trace where the denied-request log message is generated. Update the message so a negated operator is unambiguous and address the backtick and single-quote wording; done means the log clearly explains the match for the non-matching value.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.