Looking for the vulnerability index of Invicti's legacy products?
ASP.NET WCF service include exception details - Vulnerability Database

ASP.NET WCF service include exception details

Description

The ASP.NET WCF (Windows Communication Foundation) service is configured with the includeExceptionDetailInFaults property set to true in the serviceDebug behavior. This debug-oriented configuration causes the service to return detailed exception information, including stack traces and internal error messages, to all clients when errors occur. This setting is intended for development and troubleshooting purposes only and should never be enabled in production environments.

Remediation

Disable the inclusion of exception details in fault messages by setting <strong>includeExceptionDetailInFaults</strong> to <strong>false</strong> in your WCF service configuration. This should be done in the service behavior configuration section:<br/><br/><pre>&lt;system.serviceModel&gt; &lt;behaviors&gt; &lt;serviceBehaviors&gt; &lt;behavior name="YourServiceBehavior"&gt; &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt; &lt;/behavior&gt; &lt;/serviceBehaviors&gt; &lt;/behaviors&gt; &lt;/system.serviceModel&gt;</pre><br/>If you are configuring the service programmatically, use:<br/><br/><pre>ServiceDebugBehavior debugBehavior = serviceHost.Description.Behaviors.Find&lt;ServiceDebugBehavior&gt;(); if (debugBehavior == null) { debugBehavior = new ServiceDebugBehavior(); serviceHost.Description.Behaviors.Add(debugBehavior); } debugBehavior.IncludeExceptionDetailInFaults = false;</pre><br/>After making this change, implement proper logging mechanisms to capture detailed error information server-side for debugging purposes, while returning only generic error messages to clients. Verify the configuration change in all environments, especially production and staging systems.

Related Vulnerabilities