No Code Attached Yet bug
avatar dave12358
dave12358
9 Feb 2022

Steps to reproduce the issue

have apache mod_security 2.9.5 installed
on J4.x /administrator/index.php?option=com_media&path=local-images

Expected result

to see media listing

Actual result

ModSecurity: Access denied with code 400 (phase 2). Match of "eq 0" against "REQBODY_ERROR" required. [file "/etc/modsecurity/modsecurity.conf"] [line "71"] [id "200002"] [msg "Failed to parse request body."] [data "JSON parser error: parse error: premature EOF\x0a"] [severity "CRITICAL"] [hostname "xxxxxxxx"] [uri "/administrator/index.php"] [unique_id "YgPV97WMmN7SW1mSXvPM0QAAVgU"], referer: https://xxxxxxx/administrator/index.php?option=com_media&path=local-images

System information (as much as possible)

PHP 7.4.27
j4.0.6
mod_security 2.9.5

Additional comments

https://stackoverflow.com/questions/38257534/mod-security-a-rule-to-allow-post-requests-without-a-request-body

avatar dave12358 dave12358 - open - 9 Feb 2022
avatar joomla-cms-bot joomla-cms-bot - change - 9 Feb 2022
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 9 Feb 2022
avatar dave12358 dave12358 - change - 9 Feb 2022
The description was changed
avatar dave12358 dave12358 - edited - 9 Feb 2022
avatar prakhar3062
prakhar3062 - comment - 10 Feb 2022

Are you working on it

avatar dave12358
dave12358 - comment - 10 Feb 2022

Hi Prakhar,
so far I use a workaround in modsecurity.conf, something like:

SecRule REQUEST_URI /administrator "phase:1,id:400009,nolog,chain"
SecRule REQUEST_BODY_LENGTH "@eq 0" "ctl:requestBodyAccess=off"

but i'would like an opinion from joomla devs.
best regards
Dave

avatar dave12358 dave12358 - change - 10 Feb 2022
Title
[4.x] mod_security error 400 com_media - POST requests without a body
[4.x] apache mod_security error 400 com_media - POST requests without a body
avatar dave12358 dave12358 - edited - 10 Feb 2022
avatar dave12358 dave12358 - change - 10 Feb 2022
The description was changed
avatar dave12358 dave12358 - edited - 10 Feb 2022
avatar Hackwar Hackwar - change - 17 Feb 2023
Labels Added: bug
avatar Hackwar Hackwar - labeled - 17 Feb 2023

Add a Comment

Login with GitHub to post a comment