1 Information Leakage via Error Messages
Verbose error messages provide attackers with reconnaissance data that makes subsequent attacks more targeted and effective.
SQL error disclosure (PHP):
// Vulnerable: shows raw database error to users
$result = mysqli_query($conn, $sql);
if (!$result) {
die("Query failed: " . mysqli_error($conn));
// Shows: "You have an error in your SQL syntax; check the manual
// that corresponds to your MySQL 5.7.32 server version
// near 'admin' at line 1
// Reveals: database type, version, table structure
}Stack trace disclosure (Python/Flask):
@app.errorhandler(500)
def internal_error(e):
return str(e), 500 # Exposes file paths, function names, line numbers
# Example: "FileNotFoundError: [Errno 2] No such file or directory:
# /var/app/data/config/secrets.yaml
# Reveals: exact file system structure!What attackers learn from verbose errors:
- Technology stack (database type, framework, language, versions)
- File system structure and paths
- Table names, column names, query structure
- Internal IP addresses or hostnames