Skip to content

When a ModSecurity rule update breaks legitimate uploads

A ModSecurity ruleset update can start blocking legitimate WordPress media uploads or form submissions. Here is how to identify the rule and tune it safely.

A scheduled OWASP Core Rule Set or Comodo ruleset update pulls down new signatures overnight. By morning, a customer reports they can no longer upload images to a WordPress post, or a contact form submission throws a 403. The plugin didn’t change. The user is legitimate. A new rule decided their traffic looks malicious.

What’s happening

ModSecurity rule updates ship new signatures and tightened patterns regularly. The OWASP CRS Paranoia Levels shift behavior on every minor release. A signature that scored an upload as suspicious-but-allowed at PL1 may now score it as blocked at PL2 — or a rule that didn’t exist last week now matches a perfectly benign WordPress request because the heuristic is broad.

Common false-positive patterns on WordPress: multipart media uploads tripping 941100 (XSS), Gravity Forms submissions tripping 942100 (SQLi heuristic) on a textarea field, and admin AJAX requests tripping anomaly score thresholds when a legitimate form posts many fields. None of these are exploit traffic. All three look like exploits to a rule tuned for generic webapps.

How to verify

Find the blocked request in the audit log and identify the matching rule:

grep -A 30 '<client-ip>' /var/log/apache2/modsec_audit.log | tail -100
# or on a per-vhost setup:
grep '<request-id>' /etc/apache2/logs/modsec_audit/<date>/*.log

You want the Message: and Action: lines. The id field on those tells you which rule fired. On CRS specifically, look for Inbound Anomaly Score Exceeded alongside individual contributing rule IDs.

Cross-reference with the access log to confirm timing and that it’s the same request the customer reported:

grep ' 403 ' /home/<acct>/access-logs/<domain> | grep -E 'upload|gravityform|admin-ajax' | tail -20

If you see a cluster of 403s on the same path after the upgrade timestamp and clean traffic before it, the rule update is responsible.

The fix

Don’t disable ModSecurity site-wide. Tune the specific rule for the specific path. In WHM under ModSecurity Tools, locate the rule by ID and use the Disable Rule for vendor scope to scope it to the affected account, or — better — write a SecRuleUpdateTargetById exclusion that turns off the rule only for the matching URI:

<LocationMatch "/wp-admin/(async-upload|admin-ajax)\.php">
    SecRuleRemoveById 941100 942100
</LocationMatch>

Place it in the customer’s vhost include, not the global config. After applying, restart Apache or LSWS and have the customer retry the exact action. Confirm the audit log shows no further matches.

The pattern to refuse: blanket-disabling rule families because a single legitimate request tripped one. The right correction is per-path, per-rule, documented.


Stack Harbor tunes ModSecurity rule updates per customer as part of deployment management and watches for new false-positive patterns through monitoring and support. For help unblocking a customer after a ruleset update, reach our team.