How to fix: IIS version disclosed in 404 / error pages
Internet Information Services (IIS) leaks its version in the Server header and detailed error pages. These may also include the .NET CLR version via X-Powered-By and the machine name in some configurations.
Why it matters
The Microsoft-IIS version number, combined with the X-Powered-By header revealing the .NET CLR version, gives attackers a precise fingerprint to match against known IIS and ASP.NET CVEs without any active scanning. Detailed error pages may also expose the UNC path or machine name.
IIS includes its version number in the Server header by default and renders detailed error pages that can disclose the server name, .NET framework version, and path information. These can be suppressed via web.config or URL Rewrite rules.
How to fix it
- 1Remove or suppress the Server header using URL Rewrite or a custom HttpModule.
- 2In web.config, set httpErrors mode='Custom' errorMode='Custom' to disable detailed error pages.
- 3Remove the X-Powered-By header in web.config under customHeaders.
- 4Disable 'Send Detailed Error Messages' in IIS Manager under Error Pages > Edit Feature Settings.
Code examples
IIS (web.config)
<configuration>
<system.webServer>
<!-- Remove version headers -->
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
<remove name="Server" />
</customHeaders>
</httpProtocol>
<!-- Show only generic custom error pages -->
<httpErrors errorMode="Custom" existingResponse="Replace">
<remove statusCode="404" />
<error statusCode="404" path="/errors/404.html" responseMode="ExecuteURL" />
<remove statusCode="500" />
<error statusCode="500" path="/errors/500.html" responseMode="ExecuteURL" />
</httpErrors>
</system.webServer>
</configuration>References
Detected automatically by VulnRadar. The check id is iis-version-404-disclosure, stable across every scan so you can filter or diff on it.
More info disclosure checks
- MediumRails Session Cookie Missing HttpOnly Flag
- InfoServer header truncated
- InfoPHP session cookie naming exposes runtime
- Infoconfig.js / settings.js referenced (verify contents)
- Infoenv.js / environment.js referenced (verify contents)
- InfoSitemap.xml publicly accessible
- InfoOpenAPI schema version exposed in URL
- LowCORS exposes internal CDN hostname
Questions
- How severe is IIS version disclosed in 404 / error pages?
- VulnRadar rates this low severity in the info disclosure category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id iis-version-404-disclosure, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does IIS version disclosed in 404 / error pages map to?
- It maps to CWE-200. In the OWASP Top 10 it falls under A05:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.