Information Leakage Attacks: How Applications Unintentionally Reveal Sensitive Data
Information Leakage occurs when a web application unintentionally exposes sensitive data — through developer comments, verbose error messages, or plaintext content — that aids an attacker in planning SQL Injection, XSS, or other targeted attacks.
Three Categories of Information Leakage
| Category | Example |
|---|---|
| Comments in Code | HTML comment exposing server name: <!--If missing, restart VADER--> |
| Verbose Error Messages | SQL error revealing query structure and parameter names |
| Confidential Data in Plain Sight | Credentials or connection strings in source HTML |
SQL Error Message Attack Example
Placing an apostrophe in a login field may trigger a verbose error such as:
System.Data.OleDb.OleDbException: Syntax error (missing operator)in query expression 'username = ''' and password = 'g''
This reveals the username and password parameter names — exactly what an attacker needs to craft a SQL Injection payload.
Prevention Guidance
- Filter all outbound data from web applications before sending to the client.
- Intercept verbose database error messages and substitute a generic HTTP 500 response.
- Strip all developer comments from HTML before deployment.
- Redirect errors to a user-facing page that discloses no internal detail.
- Transmit server-to-client data in encrypted form.
- Remove or suppress server banners and version information.