harden: strip userinfo from the URL that auth whoami prints #608
Labels
No labels
breaking
bug
documentation
enhancement
epic
good first issue
help wanted
refactoring
resolution/duplicate
resolution/invalid
resolution/wontfix
security
severity/critical
severity/high
severity/low
severity/medium
status/abandoned
status/blocked
status/needs-decision
status/needs-info
status/needs-verification
testing
upstream
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
sixfold-space/madtea#608
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
auth whoamiprints the resolved forge URL as it is (internal/cmd/auth/whoami.go:115). The URL comes fromGetCredentialsWithSource, which returnsMADTEA_URLormadtea.urlwithout change. A hand-set URL that carriesuser:secret@hostis then printed into the terminal or a transcript. The token line is masked, but this URL is not.Fix
Print the URL with its userinfo removed, the same way
RequireSecureSchemebuilds its error text (safe.User = nil). Apply the same to every other place inwhoamithat prints a resolved URL.Acceptance
auth whoamiwithMADTEA_URL=https://user:secret@forge.example.comprintshttps://forge.example.comand never printssecret.