It was found that libuser, as used in the chfn userhelper functionality, does not properly filter out newline characters, which allows an authenticated local attacker to corrupt the /etc/passwd file and cause denial-of-service against the system. Acknowledgements: Red Hat would like to thank Qualys for reporting this issue.
This vulnerability is addressed by additional checks on GECOS field contents within the libuser library, and not in the userhelper program in the usermode package. This change will also protect other applications which use libuser.
Mitigation: Add pam_warn and pam_deny rules to /etc/pam.d/chfn and /etc/pam.d/chsh to prevent non-root users from using this functionality. With these edits, the files should contain: #%PAM-1.0 auth sufficient pam_rootok.so auth required pam_warn.so auth required pam_deny.so auth include system-auth account include system-auth password include system-auth session include system-auth Afterwards, attempts by unprivileged users to use chfn and chsh (and the respective functionality in the userhelper program) will fail, and will be logged (by default in /var/log/secure).
External References: https://access.redhat.com/articles/1537873
This issue has been addressed in the following products: Red Hat Enterprise Linux 6 Via RHSA-2015:1482 https://rhn.redhat.com/errata/RHSA-2015-1482.html
Created libuser tracking bugs for this issue: Affects: fedora-all [bug 1246225]
This issue has been addressed in the following products: Red Hat Enterprise Linux 7 Via RHSA-2015:1483 https://rhn.redhat.com/errata/RHSA-2015-1483.html
Statement: Red Hat Enterprise Linux 5 is now in Production 3 Phase of the support and maintenance life cycle. This vulnerability has been rated as having Moderate security impact and is not currently planned to be addressed in future updates. For additional information, refer to the Red Hat Enterprise Linux Life Cycle: https://access.redhat.com/support/policy/updates/errata/.
libuser-0.62-1.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.
libuser-0.62-1.fc21 has been pushed to the Fedora 21 stable repository. If problems still persist, please make note of it in this bug report.