mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-30 03:34:29 +03:00
Prevent phases from being processed more than once.
This commit is contained in:
@@ -919,7 +919,8 @@ static void hook_insert_filter(request_rec *r) {
|
||||
/* Add the input filter, but only if we need it to run. */
|
||||
if (msr->if_status == IF_STATUS_WANTS_TO_RUN) {
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
msr_log(msr, 4, "Hook insert_filter: Adding input forwarding filter %s(r %pp).", (((r->main != NULL)||(r->prev != NULL)) ? "for subrequest " : ""), r);
|
||||
msr_log(msr, 4, "Hook insert_filter: Adding input forwarding filter %s(r %pp).",
|
||||
(((r->main != NULL)||(r->prev != NULL)) ? "for subrequest " : ""), r);
|
||||
}
|
||||
|
||||
ap_add_input_filter("MODSECURITY_IN", msr, r, r->connection);
|
||||
@@ -961,7 +962,6 @@ static void hook_insert_filter(request_rec *r) {
|
||||
}
|
||||
}
|
||||
|
||||
/* NOTE: This is causing and endless loop when blocking in phase:3 */
|
||||
/**
|
||||
* Invoked whenever Apache starts processing an error. A chance
|
||||
* to insert ourselves into the output filter chain.
|
||||
@@ -975,16 +975,6 @@ static void hook_insert_error_filter(request_rec *r) {
|
||||
msr = retrieve_tx_context(r);
|
||||
if (msr == NULL) return;
|
||||
|
||||
/* Do not run if we are already running, which may happen
|
||||
* if we intercept in phase 3.
|
||||
*/
|
||||
if (msr->of_is_error == 1) {
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
msr_log(msr, 4, "Hook insert_error_filter: Already processing.");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/* Do not run if not enabled. */
|
||||
if (msr->txcfg->is_enabled == 0) {
|
||||
if (msr->txcfg->debuglog_level >= 4) {
|
||||
|
Reference in New Issue
Block a user