A form or an admin page returns 403 Forbidden
Saving a page or submitting a form returns 403 Forbidden because ModSecurity treats the request as an attack. One command shows which rule matched, and another disables it for the domain.
Symptoms
The request returns 403 Forbidden while the rest of the site works. When you run urbestack-domain-log --name example.com --type error, the domain's error log shows a line like this.
ModSecurity: Access denied with code 403 (phase 2). Operator GE matched 5 at TX:blocking_inbound_anomaly_score. [file "/usr/local/urbestack/modsec/coreruleset/rules/REQUEST-949-BLOCKING-EVALUATION.conf"] [line "233"] [id "949110"] [msg "Inbound Anomaly Score Exceeded (Total Score: 5)"]Cause
In blocking mode, ModSecurity adds to the request's score for each matching rule in the OWASP Core Rule Set. Rule 949110 totals the score and refuses the request when it reaches the limit.
The error log line names only the rule that enforces the limit. The list of refused requests shows which rule matched.
Resolution
List the domain's refused requests. For each matching rule, the list shows its
idandmessage, where it matched inmatched_in, and what it matched inmatched_text. The list updates every minute.urbestack-modsec-requests --domain example.com --state refusedFor example, rule
942100with the messageSQL Injection Attack Detected via libinjectionmatched inARGS:id.If the request came from the site itself, disable the matching rule for the domain.
urbestack-modsec-disabled-rule-add --rules 942100 --domain example.comNever disable rule
949110. Disabling it would stop every refusal.Repeat the request to check whether it still returns
403 Forbidden. If you need to keep testing, you can set ModSecurity to log the domain's matches without blocking requests.urbestack-domain-modsec-set --name example.com --mode loggingUse
--mode followto return the domain to the server's mode.To enable the rule again, run
urbestack-modsec-disabled-rule-del --rule 942100 --domain example.com.