Is this really the version you are looking for? Kentico Xperience 8.2 Documentation is no longer updated. Use the switcher in the header to choose your product version.
When designing error messages, you should always consider the level of information revealed to the user. If you reveal too much information, the user may be overwhelmed and confused. Moreover, malicious users may exploit this information to gain detailed understanding of the system.
On the other hand, if you do not provide enough information for the user to understand the problem, seeing such error messages may be very frustrating for the user.
Information you should NOT include in the error messages:
Information you should include in the error messages:
Handled and unhandled errors
The error pages should be consistent throughout the whole system. Configuring different error pages for handled errors and unhandled errors (a page redirected by ASP.NET using the <customErrors> web.config key) can be a severe security risk.
You should have only one error page for both of these cases. Find more information in the Creating custom error handling pages topic.
The time needed for processing a page after encountering an error can be considerably different from the processing time in other cases. The attackers can use this difference to guess if their input has caused any problems in the system.
There is no general recommendation on how to solve this trouble. However, you can try to provide some malicious input yourself and observe how much time it takes the system to complete the request. This way, you can find weaknesses in the system.
Instead of showing detailed information about the problem in the error message, store the debug data and stack trace into the event log. The following example logs an event in the event log:
using CMS.EventLog;
private void LogEvent(Exception ex)
{
// Logs an error type event
EventLogProvider.LogEvent(EventType.ERROR, "API Example", "APIEXAMPLE", eventDescription: "An error happened. Message: " + ex.Message + ", StackTrace:" + ex.StackTrace);
}To configure the system to display custom error messages, modify the web.config file, as described in the Web.config file settings topic.
To disable debugging and tracing before going live, see Web.config file settings.