" /> " /> "/>

How we can close webresource.axd and scriptresource.axd vulnerability in asp.net.?

2.8k Views Asked by At

We have tried below code in web.config

 <customErrors mode="On" redirectMode="ResponseRewrite" defaultRedirect="~/error.aspx" />

1

There are 1 best solutions below

2
Myke Black On

in your web.config, at the bottom just before the closing configuration tag put the following:

<location path="WebResource.axd">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
</location>

<location path="ScriptResource.axd">
    <system.web>
      <authorization>
        <deny users="*"/>
      </authorization>
    </system.web>
</location>