Skip to content

Remove deprecated REQBODY_PROCESSOR_ERROR and REQBODY_PROCESSOR_ERROR_MSG#3578

Open
hnakamur wants to merge 1 commit into
owasp-modsecurity:v2/masterfrom
hnakamur:v2/remove_deprecated_reqbody_processor_error
Open

Remove deprecated REQBODY_PROCESSOR_ERROR and REQBODY_PROCESSOR_ERROR_MSG#3578
hnakamur wants to merge 1 commit into
owasp-modsecurity:v2/masterfrom
hnakamur:v2/remove_deprecated_reqbody_processor_error

Conversation

@hnakamur

Copy link
Copy Markdown
Contributor

what

  • Rename variable generator functions to match the new variable names.
  • Remove remaining references to the deprecated variables and update tests to use the new ones.

why

The REQBODY_PROCESSOR_ERROR and REQBODY_PROCESSOR_ERROR_MSG variables were deprecated, and the new REQBODY_ERROR and REQBODY_ERROR_MSG variables were introduced in: d0e2546

REQBODY_ERROR always has the same value as REQBODY_PROCESSOR_ERROR because both use the same variable generator function. The same is true for REQBODY_ERROR_MSG and REQBODY_PROCESSOR_ERROR_MSG.

In addition, there are no remaining references to the deprecated REQBODY_PROCESSOR_ERROR or REQBODY_PROCESSOR_ERROR_MSG variables in: https://github.com/coreruleset/coreruleset

See #3576 for the discussion.

references

…_MSG

* Rename variable generator functions to match the new variable names.
* Remove remaining references to the deprecated variables and update tests to use the new ones.

Why this change?

The REQBODY_PROCESSOR_ERROR and REQBODY_PROCESSOR_ERROR_MSG variables were deprecated, and the
new REQBODY_ERROR and REQBODY_ERROR_MSG variables were introduced in:
owasp-modsecurity@d0e2546

REQBODY_ERROR always has the same value as REQBODY_PROCESSOR_ERROR because both use the same
variable generator function. The same is true for REQBODY_ERROR_MSG and REQBODY_PROCESSOR_ERROR_MSG.

In addition, there are no remaining references to the deprecated REQBODY_PROCESSOR_ERROR or
REQBODY_PROCESSOR_ERROR_MSG variables in: https://github.com/coreruleset/coreruleset

See owasp-modsecurity#3576 for the discussion.
@sonarqubecloud

Copy link
Copy Markdown

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the deprecated REQBODY_PROCESSOR_ERROR / REQBODY_PROCESSOR_ERROR_MSG variables from the default variable registry and updates bundled configs + regression tests to use the newer REQBODY_ERROR / REQBODY_ERROR_MSG equivalents.

Changes:

  • Removed registration of deprecated request-body error variables and renamed the associated generator functions to match the non-deprecated variable names.
  • Updated regression tests to reference REQBODY_ERROR instead of REQBODY_PROCESSOR_ERROR.
  • Updated sample configuration files to log REQBODY_ERROR in multipart strict-validation messages.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/regression/target/00-targets.t Removes TODO entries for deprecated variables.
tests/regression/misc/00-multipart-parser.t Replaces deprecated variable usage in multipart regression rules.
tests/modsecurity.conf-minimal Updates multipart strict-validation log message to use REQBODY_ERROR.
modsecurity.conf-recommended Updates multipart strict-validation log message to use REQBODY_ERROR.
iis/wix/modsecurity.conf Updates multipart strict-validation log message to use REQBODY_ERROR.
apache2/re_variables.c Removes deprecated variable registration and renames generator functions for the new variable names.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 707 to 710
SecRule MULTIPART_STRICT_ERROR "!\@eq 1" "phase:2,deny,id:500095"
SecRule MULTIPART_INVALID_QUOTING "!\@eq 1" "phase:2,deny,id:500096"
SecRule REQBODY_PROCESSOR_ERROR "\@eq 1" "chain,phase:2,deny,id:500097"
SecRule REQBODY_ERROR "\@eq 1" "chain,phase:2,deny,id:500097"
),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.x Related to ModSecurity version 2.x

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants