Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add value checking to @validateByteRange #3322

Merged
merged 2 commits into from
Jan 6, 2025

Conversation

airween
Copy link
Member

@airween airween commented Jan 6, 2025

what

This patch adds a value checking for operator @validateByteRange. Normally this operator allows values between 0 and 255.

The necessary check was already implemented but it was wrong place. The other problem was that in case of any error during the checks code never returned with false value - therefore the appended errors never seemed.

Unfortunately I can't add any test cases to regression tests, because the test framework does not have any option to handle these kind of errors.

why

If the admin gives an extra high value (eg 999999) then the engine exists with a segfault. @Wiz_io team reported few issues in e-mail (modsecurity at owasp dot org), the first one was this.

@airween airween requested a review from theseion January 6, 2025 15:46
src/operators/validate_byte_range.cc Show resolved Hide resolved
src/operators/validate_byte_range.cc Outdated Show resolved Hide resolved
Copy link

sonarqubecloud bot commented Jan 6, 2025

@airween airween merged commit 9e685bf into owasp-modsecurity:v3/master Jan 6, 2025
50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants