# Exposure of Sensitive Information to an Unauthorized Actor
If your application leaks information to unauthorized users, an attacker can use that vulnerability to steal information about your systems, infrastructure, and users. There are several categories of information your application may expose to an attacker:
* **Sensitive information about its users** such as personally identifiable information or private data.
* **Details about infrastructure** such as server addresses and software versions.
* **Configuration values** such as credentials for access tokens for internal and external systems.
Messages and errors shown to users should not contain sensitive information. Logs should be available only to authorized users, and log messages should be scrubbed of personally identifiable information.
## Example
The code attempts to open a database connection, but will expose information about the database when a connection error occurs:
“`php try { $connection = new mysqli($db_host, $db_user, $db_password, $db_name); } catch (Exception $e) { echo ‘Caught exception: ‘ . $e->getMessage() . ‘ connecting to ‘ . $db_host; } “` |
Error messages and configuration values should not be exposed to users. Error
conditions should be logged internally, using functions such as `error_log()`.