Skip to content

Credential Leakage through Logging Statements #11985

@YLChen-007

Description

@YLChen-007

Description:

Summary

Multiple instances of credential leakage vulnerabilities have been identified in the codebase where sensitive information (passwords, database credentials, authentication tokens) are being logged directly or exposed through exception messages.

Severity

High - Credentials exposed in logs can be accessed by unauthorized users with log file access, potentially leading to system compromise.


Vulnerability Details

1. Direct Logging of Credentials

The following locations directly log sensitive credentials:

2. Credential Exposure through Exception Messages

The following locations expose credentials through exception handling:


Correct Implementation Reference

The codebase already contains proper credential masking implementations that should be followed:


Recommended Fix

  1. Mask credentials before logging: Replace actual passwords/credentials with masked values (e.g., ****** or [REDACTED])
  2. Sanitize exception messages: Ensure exception messages don't contain sensitive data before throwing
  3. Use utility methods: Create/use existing utility methods for credential masking consistently across the codebase
  4. Code review: Audit all logging statements for potential credential exposure

Example Fix Pattern

// Before (vulnerable)
logger.debug("Connecting with password: " + password);

// After (secure)
logger.debug("Connecting with password: ******");

Impact

  • Credentials in log files can be accessed by system administrators, log aggregation systems, or attackers who gain log file access
  • Violates security best practices and compliance requirements (PCI-DSS, GDPR, etc.)
  • Increases attack surface for credential theft

References

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions