mirror of
https://github.com/owasp-modsecurity/ModSecurity.git
synced 2025-09-29 19:24:29 +03:00
Allow ability to force request body buffering to memory. Fixes MODSEC-2.
This commit is contained in:
@@ -713,6 +713,13 @@ static char *msre_action_ctl_validate(msre_engine *engine, msre_action *action)
|
||||
*/
|
||||
return NULL;
|
||||
} else
|
||||
if (strcasecmp(name, "requestBodyBuffering") == 0) {
|
||||
if (parse_boolean(value) == -1) {
|
||||
return apr_psprintf(engine->mp, "Invalid setting for ctl name "
|
||||
" requestBodyBuffering: %s", value);
|
||||
}
|
||||
return NULL;
|
||||
} else
|
||||
if (strcasecmp(name, "responseBodyAccess") == 0) {
|
||||
if (parse_boolean(value) == -1) {
|
||||
return apr_psprintf(engine->mp, "Invalid setting for ctl name "
|
||||
@@ -831,6 +838,16 @@ static apr_status_t msre_action_ctl_execute(modsec_rec *msr, apr_pool_t *mptmp,
|
||||
|
||||
return 1;
|
||||
} else
|
||||
if (strcasecmp(name, "requestBodyBuffering") == 0) {
|
||||
int pv = parse_boolean(value);
|
||||
|
||||
if (pv == -1) return -1;
|
||||
msr->txcfg->reqbody_buffering = pv;
|
||||
msr->usercfg->reqbody_buffering = pv;
|
||||
msr_log(msr, 4, "Ctl: Set requestBodyAccess to %d.", pv);
|
||||
|
||||
return 1;
|
||||
} else
|
||||
if (strcasecmp(name, "requestBodyProcessor") == 0) {
|
||||
msr->msc_reqbody_processor = value;
|
||||
msr_log(msr, 4, "Ctl: Set requestBodyProcessor to %s.", value);
|
||||
|
Reference in New Issue
Block a user