Skip to content

Hide semi-private content from Debug implementations#763

Merged
kevinaboos merged 2 commits intomainfrom
sentinel/redact-credentials-in-debug-16127328099171316821
Feb 25, 2026
Merged

Hide semi-private content from Debug implementations#763
kevinaboos merged 2 commits intomainfrom
sentinel/redact-credentials-in-debug-16127328099171316821

Conversation

@kevinaboos
Copy link
Member

@kevinaboos kevinaboos commented Feb 25, 2026

This PR addresses a security enhancement identified by Sentinel. It redacts certain content from the Debug implementation of relevant structs.

Changes:

  • src/persistence/matrix_state.rs: Manually implemented Debug for ClientSessionPersisted to redact the passphrase field.
  • src/sliding_sync.rs: Manually implemented Debug for Cli to redact the password field.
  • Added unit tests to verify the redaction.

PR created automatically by Jules for task 16127328099171316821 started by @kevinaboos

🚨 Severity: MEDIUM
💡 Vulnerability: Potential leakage of sensitive credentials (passwords, passphrases) in logs or error messages via the default `Debug` implementation.
🎯 Impact: If `Cli` or `ClientSessionPersisted` structs are logged or printed during error handling, secrets could be exposed in plain text.
🔧 Fix: Removed `#[derive(Debug)]` and manually implemented `std::fmt::Debug` for `ClientSessionPersisted` (in `src/persistence/matrix_state.rs`) and `Cli` (in `src/sliding_sync.rs`) to redact sensitive fields with `<REDACTED>`.
✅ Verification: Added unit tests `test_client_session_persisted_debug_redaction` and `test_cli_debug_redaction` to verify that secrets are not present in the debug output. These tests pass.

Co-authored-by: kevinaboos <[email protected]>
@google-labs-jules
Copy link
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@kevinaboos
Copy link
Member Author

Looks fine, just remove the tests, they're unnecessary.

@google-labs-jules
Copy link
Contributor

Looks fine, just remove the tests, they're unnecessary.

Acknowledged. I've removed the tests as requested.

🚨 Severity: MEDIUM
💡 Vulnerability: Potential leakage of sensitive credentials (passwords, passphrases) in logs or error messages via the default `Debug` implementation.
🎯 Impact: If `Cli` or `ClientSessionPersisted` structs are logged or printed during error handling, secrets could be exposed in plain text.
🔧 Fix: Removed `#[derive(Debug)]` and manually implemented `std::fmt::Debug` for `ClientSessionPersisted` (in `src/persistence/matrix_state.rs`) and `Cli` (in `src/sliding_sync.rs`) to redact sensitive fields with `<REDACTED>`.
✅ Verification: Verified locally with temporary unit tests (now removed) that secrets are not present in the debug output.

Co-authored-by: kevinaboos <[email protected]>
@kevinaboos kevinaboos changed the title 🛡️ Sentinel: [MEDIUM] Redact credentials in Debug implementations Hide semi-private content from Debug implementations Feb 25, 2026
@kevinaboos kevinaboos merged commit 182a9c4 into main Feb 25, 2026
11 checks passed
@kevinaboos kevinaboos deleted the sentinel/redact-credentials-in-debug-16127328099171316821 branch February 25, 2026 17:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant