Skip to content

fix: ConnectionProfile Debug prints the password #882

Closed

Description

@EVWorth

ConnectionProfile and SSHConfig derive Debug, so {:?} prints password, the SSH password and the passphrase in plain text.

Nothing leaks today: every #[tracing::instrument] that takes a profile skips it. #875 confirmed this while auditing logging sites. But an instrument attribute records every argument it doesn't skip, so one future ?profile, or one missed skip, writes the password to the DEBUG file log.

Where

src-tauri/crates/mas-core/src/models/connection.rs: #[derive(Debug, …)] pub struct ConnectionProfile (line 34, password at 44) and SSHConfig (password and passphrase around lines 127–130).

Fix

Replace the derive with a hand-written Debug that prints <redacted> for those fields when they're non-empty, and "" when they're empty, so empty-vs-set stays visible for debugging. Add a unit test that format!("{:?}", profile) contains no password. Check whether ConnectionProfileInput or any other type carrying a password derives Debug too.

Activity

  1. added
    bug
    on Oct 24, 2026
  2. added a commit that references this issue on Oct 24, 2026
    66dc0e9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions