Skip to content

fix: redact credentials from URLs in -vv debug logs#718

Merged
max-sixty merged 1 commit intomainfrom
fix-credential-leakage
Jan 18, 2026
Merged

fix: redact credentials from URLs in -vv debug logs#718
max-sixty merged 1 commit intomainfrom
fix-credential-leakage

Conversation

@max-sixty
Copy link
Owner

Summary

  • Add redact_credentials() function that detects URLs with embedded credentials (scheme://credentials@host) and replaces the credential portion with [REDACTED]
  • Apply redaction to both vars logging and result logging in -vv mode
  • -v output (user-facing styled output) is intentionally NOT redacted since the user is interactively watching

Test plan

  • Unit tests for various credential patterns (GitHub/GitLab tokens, user:password, git:// protocol)
  • Unit tests verify URLs without credentials are unchanged
  • Unit tests verify non-URL values pass through unchanged
  • Full test suite passes

This was written by Claude Code on behalf of max-sixty

Template expansion logs all variables in -vv mode, which could leak
credentials if remote_url contains embedded tokens (e.g.,
https://token@github.com/...).

Add redact_credentials() function that detects URLs with embedded
credentials and replaces the credential portion with [REDACTED].
Applied to both vars logging and result logging in -vv mode.

The -v output (user-facing styled output) is intentionally NOT
redacted since the user is interactively watching and expects to
see actual values for debugging templates.

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 25cb00b into main Jan 18, 2026
21 checks passed
@max-sixty max-sixty deleted the fix-credential-leakage branch January 18, 2026 20:31
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