Issue description:
Asp.net Server error [Unable to redirect to custom error
page] when three dots (…) placed after directory name in url, Custom error page will not work if below attribute is set to false.
By default in asp.net application will be configured relaxedUrlToFileSystemMapping="false,
which means each http request will be validated by ‘Server OS
file path validation component’. So when we pass (.) or (..) in URL first it
will be validated by this component then the valid request will be passed to
IIS.
By setting relaxedUrlToFileSystemMapping="true" it will
bypass the ‘Server OS file path validation’, so all the http request will
directly reach to IIS.
Same scenario has been explained in below figure.
Mitigation:
In web config:
<system.web>
<httpRuntime
targetFramework="4.5" relaxedUrlToFileSystemMapping="true"
/>
</system.web>
What is relaxedUrlToFileSystemMapping?
The RelaxedUrlToFileSystemMapping property
determines how the URL in an incoming HTTP request will be validated. If this
property is false, the URL is validated by using the same rules
that determine whether a Windows file system path is valid.
Comments
Post a Comment