Hide / Remove Stack Trace information

GQ 26 Reputation points
2021-04-13T03:14:26.99+00:00

Kindly find the link for error details.

Error 400 Stack trace sample

The background is that my users are running a web-based COTS product. Recently, the application went through a vulnerability assessment, and one of the issues found was related to the exposure of information via Stack Trace. Over at our end we tried the following:

  • Assign an error page for error 400 via IIS and restarted IIS
  • Ensure the following is correct and inside web.config: <trace enabled="false" localOnly="true">
  • Ensure the following is correct and inside web.config too: <customErrors mode="On" defaultRedirect="error.aspx" />

But the Stack Trace info still appear. I have no idea what else is causing the stack trace to still appear for that particular 400 error. The other errors were fine and catered for during the scan, with no stack trace information appearing. Anyone have any idea what else I can do? Is there a chance it's caused by the COTS application instead?

Do note that my end goal is not to resolve 400 errors, but to hide/remove stack trace information for any error 400 occurrences.

Internet Information Services
Windows Server 2016
Windows Server 2016
A Microsoft server operating system that supports enterprise-level management updated to data storage.
2,512 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Sam Wu-MSFT 7,526 Reputation points Microsoft Vendor
    2021-04-13T06:07:08.553+00:00

    Hi @GQ

    You can try to configure <requestFiltering> to DENY the verb TRACE.

    <requestFiltering>  
           <verbs>  
                 <add verb="TRACE" allowed="false" />  
           </verbs>  
     </requestFiltering>  
    

    More information you can refer to this link: verbs.


    If the answer is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.