Skip to content

Set MULTIPART_FILE_LIMIT_EXCEEDED variable#3575

Open
hnakamur wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
hnakamur:v3/set_multipart_file_limit_exceeded_variable
Open

Set MULTIPART_FILE_LIMIT_EXCEEDED variable#3575
hnakamur wants to merge 2 commits into
owasp-modsecurity:v3/masterfrom
hnakamur:v3/set_multipart_file_limit_exceeded_variable

Conversation

@hnakamur

Copy link
Copy Markdown
Contributor

what

  • Set the MULTIPART_FILE_LIMIT_EXCEEDED variable to the appropriate value.

why

  • The MULTIPART_FILE_LIMIT_EXCEEDED variable was never assigned a value.

references

  • None

@airween

airween commented Jun 16, 2026

Copy link
Copy Markdown
Member

Hi @hnakamur,

could you pick these changes or update your branch?

Thanks!

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 fixes the previously-unset MULTIPART_FILE_LIMIT_EXCEEDED transaction variable by assigning it during multipart request-body completion, and updates the multipart regression tests to assert the variable is populated (including the “no limit exceeded” cases).

Changes:

  • Set m_variableMultipartFileLimitExceeded from m_flag_file_limit_exceeded in Multipart::multipart_complete().
  • Update multipart strict-validation regression expectations so FL expands to 0 (instead of empty).
  • Add a regression assertion that MULTIPART_FILE_LIMIT_EXCEEDED expands to 1 when SecUploadFileLimit is exceeded.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
test/test-cases/regression/request-body-parser-multipart.json Adjusts expected log output to include FL 0 and adds a case asserting FL 1 when the upload file limit is exceeded.
src/request_body_processor/multipart.cc Assigns MULTIPART_FILE_LIMIT_EXCEEDED at multipart completion based on the internal file-limit flag.

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

@airween airween added the 3.x Related to ModSecurity version 3.x label Jun 16, 2026
@sonarqubecloud

Copy link
Copy Markdown

@hnakamur

Copy link
Copy Markdown
Contributor Author

Hi @airween,

I cherrypicked the merge commit of #3577 with the following command:

git cherry-pick -m 1 f5a6fcd37aea3a7618408b7d1f03b94de9164637

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.

3 participants