@@ -54,6 +54,7 @@ void *create_directory_config(apr_pool_t *mp, char *path)
5454 dcfg -> reqbody_limit = NOT_SET ;
5555 dcfg -> reqbody_no_files_limit = NOT_SET ;
5656 dcfg -> reqbody_json_depth_limit = NOT_SET ;
57+ dcfg -> arguments_limit = NOT_SET ;
5758 dcfg -> resbody_access = NOT_SET ;
5859
5960 dcfg -> debuglog_name = NOT_SET_P ;
@@ -338,6 +339,8 @@ void *merge_directory_configs(apr_pool_t *mp, void *_parent, void *_child)
338339 ? parent -> reqbody_no_files_limit : child -> reqbody_no_files_limit );
339340 merged -> reqbody_json_depth_limit = (child -> reqbody_json_depth_limit == NOT_SET
340341 ? parent -> reqbody_json_depth_limit : child -> reqbody_json_depth_limit );
342+ merged -> arguments_limit = (child -> arguments_limit == NOT_SET
343+ ? parent -> arguments_limit : child -> arguments_limit );
341344 merged -> resbody_access = (child -> resbody_access == NOT_SET
342345 ? parent -> resbody_access : child -> resbody_access );
343346
@@ -655,6 +658,7 @@ void init_directory_config(directory_config *dcfg)
655658 if (dcfg -> reqbody_limit == NOT_SET ) dcfg -> reqbody_limit = REQUEST_BODY_DEFAULT_LIMIT ;
656659 if (dcfg -> reqbody_no_files_limit == NOT_SET ) dcfg -> reqbody_no_files_limit = REQUEST_BODY_NO_FILES_DEFAULT_LIMIT ;
657660 if (dcfg -> reqbody_json_depth_limit == NOT_SET ) dcfg -> reqbody_json_depth_limit = REQUEST_BODY_JSON_DEPTH_DEFAULT_LIMIT ;
661+ if (dcfg -> arguments_limit == NOT_SET ) dcfg -> arguments_limit = ARGUMENTS_LIMIT ;
658662 if (dcfg -> resbody_access == NOT_SET ) dcfg -> resbody_access = 0 ;
659663 if (dcfg -> of_limit == NOT_SET ) dcfg -> of_limit = RESPONSE_BODY_DEFAULT_LIMIT ;
660664 if (dcfg -> if_limit_action == NOT_SET ) dcfg -> if_limit_action = REQUEST_BODY_LIMIT_ACTION_REJECT ;
@@ -1955,6 +1959,24 @@ static const char *cmd_request_body_json_depth_limit(cmd_parms *cmd, void *_dcfg
19551959 return NULL ;
19561960}
19571961
1962+ static const char * cmd_arguments_limit (cmd_parms * cmd , void * _dcfg ,
1963+ const char * p1 )
1964+ {
1965+ directory_config * dcfg = (directory_config * )_dcfg ;
1966+ long int limit ;
1967+
1968+ if (dcfg == NULL ) return NULL ;
1969+
1970+ limit = strtol (p1 , NULL , 10 );
1971+ if ((limit == LONG_MAX )|| (limit == LONG_MIN )|| (limit <= 0 )) {
1972+ return apr_psprintf (cmd -> pool , "ModSecurity: Invalid value for SecArgumentsLimit: %s" , p1 );
1973+ }
1974+
1975+ dcfg -> arguments_limit = limit ;
1976+
1977+ return NULL ;
1978+ }
1979+
19581980static const char * cmd_request_body_access (cmd_parms * cmd , void * _dcfg ,
19591981 const char * p1 )
19601982{
@@ -3596,6 +3618,14 @@ const command_rec module_directives[] = {
35963618 "maximum request body JSON parsing depth ModSecurity will accept."
35973619 ),
35983620
3621+ AP_INIT_TAKE1 (
3622+ "SecArgumentsLimit" ,
3623+ cmd_arguments_limit ,
3624+ NULL ,
3625+ CMD_SCOPE_ANY ,
3626+ "maximum number of ARGS that ModSecurity will accept."
3627+ ),
3628+
35993629 AP_INIT_TAKE1 (
36003630 "SecRequestEncoding" ,
36013631 cmd_request_encoding ,
0 commit comments