Skip to content

[repo-monitor] High: Credentials derives Debug — plaintext password exposed in logs and panics #1

@Liohtml

Description

@Liohtml

Summary

Credentials { email, password } derives #[derive(Debug)], causing the plaintext password to appear in any log output, panic backtrace, or error chain that formats this type.

Location

  • File: src/core/auth.rs
  • Line(s): 9–13, 42–47

Severity

High

Details

Any code path that formats Credentials or AuthMethod::Credentials(...) with {:?} or {:#?} — including Rust's default panic handler and anyhow/thiserror error chains — will print the plaintext password. This includes future log statements, debug output, and crash reports.

Suggested Fix

Implement a manual Debug that redacts the password:

impl fmt::Debug for Credentials {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        f.debug_struct("Credentials")
            .field("email", &self.email)
            .field("password", &"[REDACTED]")
            .finish()
    }
}

Do the same for AuthMethod. Consider making password a non-pub field.


Automated finding by repo-monitor

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions