-
Notifications
You must be signed in to change notification settings - Fork 732
False positive on 200004 MULTIPART_UNMATCHED_BOUNDARY #827
Description
Hi,
I have a .net application set up behind an Azure Application Gateway with WAF configured (owasp3.0).
When uploading files to this application I use the js File API to split the file into chunks, a common enough pattern. However, some of the chunks get blocked by the firewall (see below). This doesn't happen to all chunks but it is common enough that a 100mb file will probably encounter the issue.
I have created a barebones test website which reproduces the issue here: https://github.com/elexisvenator/AzureWAF-chunked-upload-test
I have contacted Microsoft support about this issue and while they acknowledge that the firewall is falsely blocking this request they are unwilling to disable this mandatory rule, citing that the rule is owned by a 3rd party (OWASP). They suggest that I ask here for the rule be revised.
I found a reference to MULTIPART_UNMATCHED_BOUNDARY in the ModSecurity reference manual that suggests that you should disable the rule if you get many false positives. Is this rule safe to disable if there are a large number of false positives? Should it be moved out of the 200* set of rules to make it easier to configure?
Thanks for any help you can provide
{
"resourceId": "/SUBSCRIPTIONS/[sub]/RESOURCEGROUPS/[resource_group]/PROVIDERS/MICROSOFT.NETWORK/APPLICATIONGATEWAYS/[applicaiton_gateway]",
"operationName": "ApplicationGatewayFirewall",
"time": "2017-06-28T23:26:21Z",
"category": "ApplicationGatewayFirewallLog",
"properties": {
"instanceId": "ApplicationGatewayRole_IN_0",
"clientIp": "IP ADDRESS",
"clientPort": "0",
"requestUri": "/api/File/Upload?resumableChunkNumber=8&resumableChunkSize=1048576&resumableCurrentChunkSize=1048576&resumableTotalSize=13411785&resumableType=application%2Fpdf&resumableIdentifier=068099c3-b1cd-7370-2176-29e843fa61dc&resumableFilename=NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)%20(2).pdf&resumableRelativePath=NET-Microservices-Architecture-for-Containerized-NET-Applications-(Microsoft-eBook)%20(2).pdf&resumableTotalChunks=12",
"ruleSetType": "OWASP",
"ruleSetVersion": "3.0",
"ruleId": "200004",
"message": "Mandatory rule. Cannot be disabled. Multipart parser detected a possible unmatched boundary.",
"action": "Blocked",
"site": "Global",
"details": {
"message": "Access denied with code 403 (phase 2). Match of \"eq 0\" against \"MULTIPART_UNMATCHED_BOUNDARY\" required.",
"data": "",
"file": "",
"line": ""
}
}
}