Skip to content
This repository was archived by the owner on Jul 10, 2024. It is now read-only.

Security issue: setpassword command exposes password on command line #177

@jtpereyda

Description

@jtpereyda

The anchore-cli account user setpassword appears to only allow the password to be specified in the command line arguments. Command line arguments can be exposed to other users on the OS, can end up in logs (such as bash history), etc. See https://cwe.mitre.org/data/definitions/214.html for more info on this type of vulnerability.

Password changes are a natural fit for an interactive UI, as they rarely need to be scripted. The getpass module makes getting the input easy.

> anchore-cli account user setpassword --help
Usage: anchore-cli account user setpassword [OPTIONS] USER_PASSWORD

Options:
  --username TEXT  Optional user name
  --account TEXT   Optional account name
  -h, --help       Show this message and exit.

Partial workaround: One can keep bash commands out of bash history by starting them with a space, assuming their system is configured properly. This trick is not universally known and not everybody will use it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions