Skip to content

ModSec 2.7.5 for Nginx does not forward files over 8k to backend #575

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

Closed
rcbarnett-zz opened this issue Oct 17, 2013 · 2 comments
Closed
Assignees

Comments

@rcbarnett-zz
Copy link
Contributor

MODSEC-427: ModSec for Nginx processes only the first chunk from only 8k files. Backend will timeout waiting for the next chunk or the end message which never come. Only workaround at this point is to disable "SecRequestBodyAccess"

BUG: Requests in excess of 8k are not forwarded.

REASON: It seems only the first chunk is forwarded--there's no logic to
forward the rest of the chunks.

PROPOSED FIX:
diff --git a/apache2/apache2_io.c b/apache2/apache2_io.c
index 88f1903..6629c4a 100644
--- a/apache2/apache2_io.c
+++ b/apache2/apache2_io.c
@@ -66,6 +66,7 @@ apr_status_t input_filter(ap_filter_t *f,
apr_bucket_brigade *bb_out,
" (f %pp, r %pp).", mode, block, nbytes, f, f->r);
}

+again:
if (msr->if_started_forwarding == 0) {
msr->if_started_forwarding = 1;
rc = modsecurity_request_body_retrieve_start(msr, &my_error_msg);
@@ -154,6 +155,8 @@ apr_status_t input_filter(ap_filter_t *f,
apr_bucket_brigade *bb_out,
if (msr->txcfg->debuglog_level >= 4) {
msr_log(msr, 4, "Input filter: Input forwarding complete.");
}

  • } else {

  •    goto again;
    

    }

    return APR_SUCCESS;

@ghost ghost assigned zimmerle Oct 17, 2013
@rcbarnett-zz
Copy link
Contributor Author

Original reporter: wellumies

@zimmerle
Copy link
Contributor

Duplicate of issue #142

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

No branches or pull requests

2 participants