Skip to content

Unescaped password passed as argument to /bin/echo #43

@jrusnack

Description

@jrusnack

command => "/bin/echo ${::pacemaker::hacluster_pwd} | /usr/bin/passwd --stdin hacluster",

exec {"Set password for hacluster user on $cluster_name":
  command => "/bin/echo ${::pacemaker::hacluster_pwd} | /usr/bin/passwd --stdin hacluster",

The value of ::pacemaker::hacluster_pwd is passed as command line argument to /bin/echo. This has 2 unintended consequences:

  • the password may include special characters, such as $ ; ( , which will be interpreted.
  • the password will be visible in process list, because echo is a shell builtin, but /bin/echo is not. This may disclose the password to local attacker depending on scenario.

Acknowledgement: this issue was found by Florian Weimer of Red Hat.

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