Error Upload File on Centos Server | ModSecurity: Access denied “MULTIPART_UNMATCHED_BOUNDARY” required

Chalid Ade Rahman
2 min readDec 29, 2020

--

Photo by Kyle Sung on Unsplash

I have error when trying to upload file on my web application using centos server. Then i do something like this :

  • I check my code for handling upload file and there’s nothing wrong, cause when i try in local server it’s work.
  • I check php.ini configuration for max upload file at /etc/php.ini then make sure Maximum allowed size for uploaded files and all it’s great. upload max file is 128Mb. But i’m still got error.
  • Then i check on log at /var/log/httpd/ssl_error_log and i got error message like this.

[Mon Dec 28 17:50:54 2020] [error] [client 172.69.35.48] ModSecurity: Access denied with code 44 (phase 2). Match of “eq 0” against “MULTIPART_UNMATCHED_BOUNDARY” required. [file “/etc/httpd/conf.d/mod_security.conf”] [line “39”] [id “200003”] [msg “Multipart parser detected a possible unmatched boundary.”] [hostname “ereport.ptp.co.id”] [uri “/sop_revisi”] [unique_id “X@m4in8AAAEAAElKIBoAAAAF”]

  • This error message said that Multipart parser detected a possible unmatched boundary. I don’t know what is it but when i search for solution. I must to comment some line on file /etc/httpd/conf.d/mod_security.conf.

Solution

  • I open file /etc/httpd/conf.d/mod_security.conf
  • Search for this code, MULTIPART_UNMATCHED_BOUNDARY
  • Give comment with add “#”
  • Then restart httpd using command service httpd restart
  • Then i try to upload it again and success, That’s it. hope it help.

Reference

  1. https://github.com/SpiderLabs/ModSecurity/issues/1804
  2. https://github.com/SpiderLabs/ModSecurity/commit/7def498c4c043fd857689c7cc47a64d2bdf0badb

Thank for reading my articles

If you have any question or opportunity you can connect with me on

  1. Instagram : @sambatngoding , @chalidade
  2. LinkedIn : https://www.linkedin.com/in/chalidaderahman/
  3. Email : Chalidade@gmail.com

And here if you wanna give me some cup of coffee

https://www.paypal.me/chalidade

--

--

Chalid Ade Rahman
Chalid Ade Rahman

Written by Chalid Ade Rahman

PHP Programmer | PT Electronic Data Interchange Indonesia | Question : chalidade@gmail.com

No responses yet