Control Web Panel

WebPanel => CentOS 9 Problems => Topic started by: Insan3Us on September 15, 2024, 06:54:21 AM

Title: mod_security not allow to upload files
Post by: Insan3Us on September 15, 2024, 06:54:21 AM
Hi,
When I enable mod_security with Comodo WAF, when I try to upload files on my website I get this from website script:
https://ibb.co/ccFthQB
But my PHP upload limit is higher then the file that I want to upload...is like mod_Security ignore the php settings.

I don't get any errors in mod_security log... just this one:

 
Code: [Select]
ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.env" at REQUEST_URI. [file "/usr/local/apache/modsecurity-cwaf/rules/02_Global_Generic.conf"] [line "117"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "86.48.7.222"] [uri "/.env"] [unique_id "ZuXGOVr11PHxbzo61HtErgAAAIY"]
But I disabled the rules for id 210492...and now I don't get this error anymore, nothing in the logs...when I disable mod_security is working to upload files...
Someone know from where it is?

Thank you!
Title: Re: mod_security not allow to upload files
Post by: cyberspace on September 15, 2024, 11:36:41 AM
Make sure the rule is disabled, make a new attempt to upload the file and then check the error log file of the website:

Code: [Select]
/usr/local/apache/domlogs/domlogs/DOMAIN.COM.error_log
if the new attempt fails.
Title: Re: mod_security not allow to upload files
Post by: Insan3Us on September 15, 2024, 01:56:51 PM
Make sure the rule is disabled, make a new attempt to upload the file and then check the error log file of the website:

Code: [Select]
/usr/local/apache/domlogs/domlogs/DOMAIN.COM.error_log
if the new attempt fails.

I solve it!
Was from 2 option settings, I had to add in mod_security.conf

Thank you!
Title: Re: mod_security not allow to upload files
Post by: overseer on September 18, 2024, 04:55:53 PM
It's always helpful to leave the actual, detailed solution in the thread for the sake of others searching for the same solution.
Title: Re: mod_security not allow to upload files
Post by: abud3d on October 07, 2024, 06:42:35 PM
Quote
I solve it!
Was from 2 option settings, I had to add in mod_security.conf
Thank you!

What is the solution followed? :( plz
Title: Re: mod_security not allow to upload files
Post by: BeZazz on October 07, 2024, 11:07:03 PM
Have a look at (might help)
https://forum.centos-webpanel.com/mod_security/forbidden-access-to-the-email-confirmation-link/msg48715/#msg48715