Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Registry token shown in debug logs #9822

Closed
pietroalbini opened this issue Aug 22, 2021 · 1 comment · Fixed by #9873
Closed

Registry token shown in debug logs #9822

pietroalbini opened this issue Aug 22, 2021 · 1 comment · Fixed by #9873
Assignees
Labels
C-bug Category: bug

Comments

@pietroalbini
Copy link
Member

pietroalbini commented Aug 22, 2021

Problem

When publishing a crate with debug logging enabled, the full, plaintext registry token is included in the output. This is bad when users are trying to figure out what's wrong with cargo publish and end up sending their logs to another person to help debugging, or worse they post the log in a public issue.

Steps

CARGO_LOG=debug cargo publish 2>&1 | grep "found token \"cio"

Possible Solution(s)

The log message is defined here:

log::debug!("found token {:?}", token);

The log message should either be removed or it should be changed to only display the last N chars of the API token (to still allow someone debugging cargo to know which token it picked up).

Notes

Output of cargo version:

cargo 1.54.0 (5ae8d74b3 2021-06-22)
release: 1.54.0
commit-hash: 5ae8d74b3b2d58f32c8d357e5cfa04d430a70e0b
commit-date: 2021-06-22
@pietroalbini pietroalbini added the C-bug Category: bug label Aug 22, 2021
@Rustin170506
Copy link
Member

@rustbot claim

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants