Reputation: 4039
In my ASP.NET MVC application, I want to resolve the HTTP Request Smuggling Vulnerability issue.
I thought it would be sufficient if I blocked the requests which have a Transfer-Encoding: chunked
header. In the IIS administration menu, I added a new Request Filtering rule for this. However that does not seem to fix it.
I wrote little .NET code to test if IIS generates a 404 error when chunked content is sent. When I add the transfer encoding header 1 time to my test client code as below, I do NOT receive 404—I receive 200.
httpRequest.Headers.Add("Transfer-Encoding", "chunked");
Interestingly, if I add the header 2 times (I mean duplicate it) like
httpRequest.Headers.Add("Transfer-Encoding", "chunked");
httpRequest.Headers.Add("Transfer-Encoding", "chunked");
The filtering rule applies, and I receive 404 as I expected.
How can I fix it?
Upvotes: 2
Views: 9257
Reputation: 9323
A few months later, Microsoft added a patch wherein you can disable request smuggling with a registry key.
- Click Start, click Run, type
Regedit
in the Open box, and then click OK.- Locate and then click the following registry subkey:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\HTTP\Parameters
- Set
DWORD
type valueDisableRequestSmuggling
to one of the following:
- Set to 0 to disable the filter
- Set to 1 to enable the filter
- Exit Registry Editor.
- Restart the computer.
Upvotes: 2