Skip to content

cargo login shows passwords in plain text #7813

Open

Description

@jyn514

Describe the problem you are trying to solve
When I run cargo login, it tells me to type in my password then shows the password in plaintext.

Describe the solution you'd like
cargo login should either show no output (like sudo) or only asterisks (like openvpn or a user login screen).

Notes
I don't like the idea that someone looking over my shoulder can see my passwords.

Activity

  1. added
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    on Jan 18, 2020
  2. stefanhoelzl commented on Jan 20, 2020

    @stefanhoelzl

    what password you are required to enter?

    when I run cargo login I am only prompted to enter a API token.

  3. jyn514 commented on Jan 20, 2020

    @jyn514
    MemberAuthor

    Yes, the API token is what I mean.

  4. added a commit that references this issue on Feb 6, 2020
    aafa1d1
  5. epage commented on Nov 3, 2023

    @epage
    Contributor

    #7869 used rpassword. Looks like this is used in sequoia-openpgp among many other places.

    dialoguer is another potential library for this.

  6. added
    S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
    S-needs-team-inputStatus: Needs input from team on whether/how to proceed.
    and removed
    S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
    on Nov 3, 2023
  7. ehuss commented on Jun 15, 2026

    @ehuss
    Contributor

    The cargo team discussed this issue (notes). I was not at the meeting, but it looks like the team was generally positive to supporting this, but there was some question about exactly which crate to use to support this. There are some thoughts in the linked notes.

  8. added
    S-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.
    and removed
    S-needs-team-inputStatus: Needs input from team on whether/how to proceed.
    on Jun 15, 2026
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

    A-console-outputArea: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Command-loginS-needs-mentorStatus: Issue or feature is accepted, but needs a team member to commit to helping and reviewing.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions