Issue
Error: ModSecurity: Request body no files data length is larger than the configured limit (10...).. Deny with code (413)
Environment
- Imunify products
- ModSecurity
- cPanel
- Plesk
- DirectAdmin
Solution
1. For cPanel
1.1. To resolve this issue, please try to find in the Apache config the following options: SecRequestBodyLimit and SecRequestBodyNoFilesLimit and increase their value.
Also, you can add these options to the /etc/apache2/conf.d/modsec/modsec2.user.conf if you haven't found them in the *.conf.
1.2. Restart the Apache service:
# systemctl restart httpd
2. For Plesk
The /etc/httpd/conf.d/modsec2.imunify.conf does re-write during an update.
So it is possible to create the /etc/httpd/conf/modsecurity.d/custom.conf
grep -r modsecurity.d /etc/httpd/
/etc/httpd/conf.d/security2.conf: IncludeOptional "/etc/httpd/conf/modsecurity.d/*.conf"
# cat /etc/httpd/conf/modsecurity.d/custom.conf
<IfModule security2_module>
SecRequestBodyLimit SOME_VALUE
SecRequestBodyNoFilesLimit SOME_VALUE
</IfModule>
How to check:
# httpd -DDUMP_CONFIG -k start | grep SecRequestBody
3. For DirectAdmin
3.1. The default value could be placed in the ModSecurity configuration file shipped by DirectAdmin:
# grep -ir 131072 /etc/httpd
/etc/httpd/conf/extra/httpd-modsecurity.conf: SecRequestBodyNoFilesLimit 131072
3.2. To resolve the issue, increase the value and restart Apache:
# grep SecRequestBodyNoFilesLimit /etc/httpd/conf/extra/httpd-modsecurity.conf
SecRequestBodyNoFilesLimit 1310720
# systemctl restart httpd
Note that you can also manage the mentioned options for other panels and on servers without a control panel. You Just need to find a proper .conf file
Comments
0 comments
Please sign in to leave a comment.