ANOMALY_SCORE_EXCEEDED
The ANOMALY_SCORE_EXCEEDED error occurs when a request is blocked by the OWASP Core Ruleset managed ruleset. The OWASP CRS uses an anomaly scoring model: each rule that matches a request adds points to a cumulative score. When the total score exceeds the configured threshold, the request is denied with this error.
This typically means the request contained patterns associated with common web threats (SQL injection, cross-site scripting, etc.) that triggered enough OWASP rules to exceed the blocking threshold.
ANOMALY_SCORE_EXCEEDED:
Forbidden
If the blocked request is legitimate traffic (a false positive), the project owner can adjust the firewall configuration:
- Review matched rules:
- Set rules to Log mode: For rules causing false positives, change the action from Deny to Log. This allows you to monitor traffic without blocking it while you assess whether the rule applies to your application
- Disable overly aggressive rules: If certain rules consistently trigger with legitimate traffic, consider disabling them. Review each rule's purpose to ensure you're not reducing security unnecessarily
- Create bypass rules: Use a WAF Custom Rule with a bypass action to allow specific requests that should not be evaluated by the OWASP ruleset
- Monitor firewall logs: After making changes, monitor the Firewall overview page to verify that legitimate traffic is no longer blocked and that your application remains protected
For more details on configuring the OWASP Core Ruleset, see WAF Managed Rulesets.
You can also investigate and resolve ANOMALY_SCORE_EXCEEDED errors using the Vercel CLI and API.
Use the CLI to filter logs for blocked requests:
vercel logs --status-code 403 --since 1hFor JSON output with full request details:
vercel logs --status-code 403 --jsonSearch for the specific error code:
vercel logs --query "ANOMALY_SCORE_EXCEEDED" --since 1hThe JSON output includes firewall-specific fields in the proxy object:
proxy.wafAction: The action taken (log,deny,challenge,bypass,rate_limit)proxy.wafRuleId: The ID of the firewall rule that matched
Query your project's firewall config via the API:
vercel api /v1/security/firewall/config?projectId=<project-id>To switch a rule to Log mode, use a PATCH request:
vercel api /v1/security/firewall/config?projectId=<project-id> -X PATCH \
--input config.jsonWhere config.json contains:
{
"action": "crs.update",
"id": "xss",
"value": { "active": true, "action": "log" }
}Available OWASP rule IDs: sd (scanner detection), ma (multipart attack), lfi (local file inclusion), rfi (remote file inclusion), rce (remote code execution), php, gen (generic), xss, sqli (SQL injection), sf (session fixation), java.
To disable a rule entirely, set "active": false or use the crs.disable action.
Add a bypass rule with rules.insert:
{
"action": "rules.insert",
"value": {
"name": "Bypass for internal API",
"action": "bypass",
"conditions": [{ "type": "path", "op": "pre", "value": "/api/internal" }]
}
}For continuous monitoring, use Log Drains with source: "firewall" to stream WAF events to your SIEM or logging infrastructure.
You can also manage firewall rules as code using the Terraform provider with the vercel_firewall_config resource.
Was this helpful?