owasp-modsecurity / owasp-modsecurity/ModSecurity
Log message should indicate if operator is negative
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
- 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
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