Existe um blog da Microsoft (citado abaixo) abordando isso. Embora seja escrito para o IIS7, o conteúdo ainda se aplica à versão atual do IIS.
Se preferir não definir allowDoubleEscaping=true
, uma alternativa é colocar o URL na lista de permissões. O comando a seguir fará exatamente isso para o seu arquivo se ele residir no Site Padrão. Observe que, ao colocar um URL na lista de permissões, qualquer parâmetro de string de consulta pode ser usado. Não é um grande problema com um jpg de teste, embora muito mais importante ao garantir um site / aplicativo maior.
appcmd.exe set config "Default Web Site" -section:system.webServer/security/requestFiltering /+"alwaysAllowedUrls.[url='/+.jpg']"
Here is the deal. The IIS7 request filter rejects URLs containing + characters. We do this because the + character is a dangerous choice. Some standards, e.g. the CGI standard require +'s to be converted into spaces. This can become a problem if you have code that implements name-based rules, for example urlauthorization rules that base their decisions on some part of the url.
Here is a cooked up example:
Let's suppose you have code that evaluates the following rule:
<authorization vdir="my vdir">
<allowed users="Administrators"/>
</authorization>
With the ambiguity of leaving +'s in place or converting +'s to spaces there is a possiblity that your rule engine allows access to a non-Admin, for example if the attacker enters http://myserver/my+vdir. The "my vdir" authorization rule won't match because your authorization code searches for the string "my+vdir" but your rule says "my vdir". Your rule won't apply and the attacker gets access.
If you absolutely want to have spaces you can simply turn off the doubleEscaping feature for your application, for your site or for the whole server. Here is an example:
%windir%\system32\inetsrv\appcmd set config "Default Web Site" -section:system.webServer/security/requestfiltering -allowDoubleEscaping:true
Source: https://blogs.iis.net/thomad/iis7-rejecting-urls-containing