After upgrade from CentOS 7 to RockyLinux 8 I am getting this hit in modsec blocking some applications from submitting login request to my backend.
However, I have checked for occurances of "allowed_request_content_type" in modsec conf, and it appears to me there should be no problem here:
./REQUEST-901-INITIALIZATION.conf:
./REQUEST-920-PROTOCOL-ENFORCEMENT.conf:
All configurations are enabled in ModSec Vendor Rule Sets.
Message: Warning. Match of "rx ^%{tx.allowed_request_content_type}$" against "TX:0" required. [file "/etc/apache2/conf.d/modsec_vendor_configs/OWASP3/rules/REQUEST-920-PROTOCOL-ENFORCEMENT.conf"] [line "440"] [id "920420"] [rev "2"] [msg "Request content type is not allowed by policy"] [data "application/x-www-form-urlencoded"] [severity "CRITICAL"] [ver "OWASP_CRS/3.0.0"] [maturity "9"] [accuracy "9"] [tag "application-multi"] [tag "language-multi"] [tag "platform-multi"] [tag "attack-protocol"] [tag "OWASP_CRS/POLICY/ENCODING_NOT_ALLOWED"] [tag "WASCTC/WASC-20"] [tag "OWASP_TOP_10/A1"] [tag "OWASP_AppSensor/EE2"] [tag "PCI/12.1"]
However, I have checked for occurances of "allowed_request_content_type" in modsec conf, and it appears to me there should be no problem here:
./REQUEST-901-INITIALIZATION.conf:
SecRule &TX:allowed_request_content_type "@eq 0" "id:901162, phase:1, pass, nolog, setvar:'tx.allowed_request_content_type=application/x-www-form-urlencoded|multipart/form-data|text/xml|application/xml|application/soap+xml|application/x-amf|application/json|application/octet-stream|text/plain'"
./REQUEST-920-PROTOCOL-ENFORCEMENT.conf:
SecRule TX:0 "!^%{tx.allowed_request_content_type}$" "t:none, ctl:forceRequestBodyVariable=On, setvar:'tx.msg=%{rule.msg}', setvar:tx.anomaly_score=+%{tx.critical_anomaly_score}, setvar:tx.%{rule.id}-OWASP_CRS/POLICY/CONTENT_TYPE_NOT_ALLOWED-%{matched_var_name}=%{matched_var}"
All configurations are enabled in ModSec Vendor Rule Sets.