Information Leakage

  • CAPEC 118
  • CWE 200
  • WASC 13
  • OWASP PC-C7

Information Leakage occurs when an application inadvertently exposes sensitive data that could aid an attacker in compromising the system or its users. This type of vulnerability arises from poor handling of error messages, verbose debugging information, misconfigured servers, excessive headers, metadata exposure, or improperly sanitized responses. Unlike direct exploitation vulnerabilities, information leakage often serves as a precursor to attacks, providing attackers with reconnaissance data such as system architecture, software versions, file paths, or API endpoints.

Common patterns leading to information leakage:

  • Detailed error messages or stack traces exposed to users.
  • Verbose HTTP headers revealing server, framework, or application version.
  • Publicly accessible backup files, directories, or source code.
  • Disclosure of sensitive data in comments, logs, or HTML/JavaScript content.
  • Insecure API responses returning unnecessary or sensitive data fields.
  • Leaking tokens, credentials, or session identifiers in URLs or headers.

Impacts:

  • Reconnaissance: Helps attackers understand the system, software versions, and potential vulnerabilities.
  • Facilitates Targeted Attacks: Enables SQL Injection, Cross-Site Scripting, Remote Code Execution, or privilege escalation by revealing weak points.
  • Sensitive Data Exposure: May inadvertently expose personal information, API keys, or internal configurations.
  • Reputation and Compliance Risks: Exposure of user or organizational data can lead to regulatory violations and reputational damage.

Detection indicators:

  • Response headers containing detailed server or framework information.
  • Error pages showing stack traces, database queries, or configuration data.
  • Metadata in files (images, documents) containing sensitive information.
  • Excessive debug information visible in production environments.
  • Unintended data returned in API responses.
Remediation

Preventing information leakage involves controlling what data is exposed, sanitizing outputs, and securing the environment:

  1. Sanitize Error Messages and Responses
    Display generic error messages to users while logging detailed errors internally for debugging purposes.

  2. Disable Debug and Verbose Logging in Production
    Ensure development tools and debug settings are turned off in production.

  3. Control HTTP Headers
    Remove or mask server banners, version numbers, and framework information in headers.

  4. Secure Sensitive Files and Directories
    Store backups, logs, source code, and configuration files outside the web root with restricted permissions.

  5. Review API Responses
    Return only necessary data; avoid sending extra fields or internal identifiers to clients.

  6. Metadata Scrubbing
    Remove sensitive metadata from files uploaded or served publicly.

  7. Implement Access Control
    Ensure sensitive information is accessible only to authorized users.

  8. Regular Security Testing
    Conduct automated scanning, penetration testing, and code review to detect information leakage vectors.

  9. Principle of Least Privilege
    Limit access permissions for web servers, applications, and system processes to minimize potential exposure.

  10. Monitoring and Alerting
    Monitor logs and responses for accidental disclosure of sensitive data, and alert on abnormal patterns.

References