Skip to content

[Bug] DEBUG log statements at INFO/ERROR level left in production code, one leaks auth tokens #633

@rohansx

Description

@rohansx

Bug

15 log statements prefixed with "DEBUG:" are left at INFO, WARNING, and ERROR log levels in production code:

  • app/modules/users/user_service.py — 8 instances (lines 123, 128, 132, 135, 155, 160, 163, 166)
  • app/modules/auth/auth_service.py — 7 instances (lines 80, 81, 82, 87, 95, 104, 122)

Security concern

Line 104 in auth_service.py logs the first 20 characters of the Firebase auth token at INFO level:

logging.info("DEBUG: Verifying Firebase token: %s...", credential.credentials[:20])

This leaks credential data into log files and log aggregators.

Impact

  • Credential leakage: Partial auth tokens written to logs at INFO level
  • Log noise: 15 debug statements pollute production logs since they run at INFO/WARNING/ERROR level instead of DEBUG
  • PII exposure: User emails logged at INFO level in user_service.py

Expected behavior

These debug statements should be removed entirely. The auth flow and user lookups are standard operations that don't need verbose logging in production.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions