cloud-init logs leak hashed passwords
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Fix Released
|
Critical
|
Unassigned |
Bug Description
The recent update of cloud-init to Version: 22.2-0ubuntu1~
has started logging a warning that includes hashed passwords into at least three files readable by all users-
/var/
2022-06-12 21:23:48,866 - util.py[DEBUG]: Read 100004 bytes from /usr/lib/
2022-06-12 21:23:48,963 - schema.py[WARNING]: Invalid cloud-config provided:
users.0: {'gecos': 'Mike Stroyan', 'groups': ['adm', 'cdrom', 'dip', 'plugdev', 'lxd', 'sudo'], 'lock-passwd': False, 'name': 'mike', 'passwd': 'HASHED_PASSWORD!', 'shell': '/bin/bash'} is not valid under any of the given schemas
2022-06-12 21:23:48,964 - util.py[DEBUG]: Reading from /var/lib/
/var/
2022-06-12 21:23:48,963 - schema.py[WARNING]: Invalid cloud-config provided:
users.0: {'gecos': 'Mike Stroyan', 'groups': ['adm', 'cdrom', 'dip', 'plugdev', 'lxd', 'sudo'], 'lock-passwd': False, 'name': 'mike', 'passwd': 'HASHED_PASSWORD!', 'shell': '/bin/bash'} is not valid under any of the given schemas
/var/log/syslog
Jun 12 15:23:49 b2 cloud-init[800]: 2022-06-12 21:23:48,963 - schema.py[WARNING]: Invalid cloud-config provided:
Jun 12 15:23:49 b2 cloud-init[800]: users.0: {'gecos': 'Mike Stroyan', 'groups': ['adm', 'cdrom', 'dip', 'plugdev', 'lxd', 'sudo'], 'lock-passwd': False, 'name': 'mike', 'passwd': 'HASHED_PASSWORD!', 'shell': '/bin/bash'} is not valid under any of the given schemas
Jun 12 15:23:49 b2 systemd[1]: Finished Initial cloud-init job (metadata service crawler).
It looks like the warning about not being compliant with schemas comes from both the use of a "lock-passwd" key and by representation of users groups as an array of strings instead of a single string containing a comma separated list of groups.
/var/lib/
That was later changed to "lock_passwd" in this pull merge-
https:/
But installations done with the original 20.04 release will still have "lock-passwd".
That propagates to several files in /var/lib/
The treatment of the "groups" key as an array of strings continues in subiquity.
Both "lock-passwd" and "groups" conflict with /usr/lib/
That would be more minor issue if the warning put into multiple log files didn't contain the password hash that is otherwise only readable by root.
CVE References
information type: | Private Security → Public Security |
Changed in cloud-init: | |
status: | Triaged → Fix Released |
Thanks Mike. We'll get this fixed ASAP.