Skip to content

ProcessPartial mode does not function as expected #705

@spectrumjade

Description

@spectrumjade

I'm currently rolling out ModSecurity, and I've found that ProcessPartial mode does not function as one would expect.

As I understand it, the expected behavior is that ModSec will buffer as much of the request body as it is configured to (based on SecRequestBodyLimit) and use that as a basis for rule processing while allowing the request to pass through (in accordance with the rules).

What actually seems to happen is that the entire request body will be buffered, regardless of the limits set (prior to my earlier patch, #597, it would reject the request based on the Content-Length header in phase 1). This is not ideal for me, as I do not want data to be buffered to disk at all, and buffering entire requests (which may be as large as 5 GB) in memory has a number of disadvantages.

I had attempted to make some small changes to the input filter, but ultimately these ended poorly (requests being truncated under certain circumstances, not unlike #406). I've had to employ a really unfortunate workaround so that ModSec is usable (basically just disabling buffering for larger requests).

Does anyone else see this behavior? Perhaps I'm missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions