COMMON WEAKNESS ENUMERATIONIncomplete

CWE-211

Externally-Generated Error Message Containing Sensitive Information

The product performs an operation that triggers an external diagnostic or error message that is not directly generated or controlled by the product, such as an error generated by the programming language interpreter that a software application uses. The error can contain sensitive system information.

Abstraction

Base

Structure

Simple

Likelihood of Exploit

Medium

Understand the problem

What is the problem?

The product performs an operation that triggers an external diagnostic or error message that is not directly generated or controlled by the product, such as an error generated by the programming language interpreter that a software application uses. The error can contain sensitive system information.

Root cause

How and when does the problem arise?

Lifecycle phase

Architecture and Design

PHP applications are often targeted for having this issue when the PHP interpreter generates the error outside of the application's control. However, other languages/environments exhibit the same issue.

Lifecycle phase

Implementation

REALIZATION: This weakness is caused during implementation of an architectural security tactic.

Lifecycle phase

Operation

Risk

What does successful exploitation lead to?

Read Application Data

Affected security scopes: Confidentiality

Defence

How is it prevented and fixed?

System Configuration

Secure configuration approach

Detail
Configure the application's environment in a way that prevents errors from being generated. For example, in PHP, disable display_errors.

Implementation · Build and Compilation

Compilation or Build Hardening

Detail
Debugging information should not make its way into a production release.

Implementation · Build and Compilation

Environment Hardening

Detail
Debugging information should not make its way into a production release.

Implementation

Implementation-phase defence

Detail
Handle exceptions internally and do not display errors containing potentially sensitive information to a user. Create default error pages if necessary.

Implementation

Implementation-phase defence

Detail
The best way to prevent this weakness during implementation is to avoid any bugs that could trigger the external error message. This typically happens when the program encounters fatal errors, such as a divide-by-zero. You will not always be able to control the use of error pages, and you might not be using a language that handles exceptions.