Skip to content

Conversation

airween
Copy link
Member

@airween airween commented Sep 16, 2025

what

This PR fixes the wrong behavior: variable names are treated as case sensitive. Also it contains two new test cases for regression tests.

why

An issue opened (see below) where the reporter explained the problem: if an exclusion adds a collection member with lowercase, it won't have any effect during the rule evaluation.

The issue mentions only the REQUEST_HEADERS collection, but that's true for all targets.

mod_security2 Apache module uses strncasecmp() in all cases, not just REQUEST_HEADERS.

additional notes

I didn't want to mix C and C++ functions, this is why I ignored strncasecmp(). I also wanted to avoid copying strings and create new functions to comparing strings, so the only solution seemed to be to use std::equal() with a lambda function.

references

#3441

@airween airween added the 3.x Related to ModSecurity version 3.x label Sep 16, 2025
@airween airween requested a review from theseion September 16, 2025 15:22
Copy link

@airween airween requested a review from theseion September 17, 2025 07:21
@airween airween merged commit e523d72 into owasp-modsecurity:v3/master Sep 17, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.x Related to ModSecurity version 3.x
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants