An information disclosure flaw was found in the way libuser, an user and group account administration library, performed movement of user's home directory. Previously, during the move the ownership of all the (sub)entries present in directory tree, to be moved, were changed from privileged user account to the effective user id of the user, the home directory should belong to. A local attacker could use this flaw to conduct hardlink attacks and possibly obtain unauthorized access to arbitrary system file. This issue was found by Miloslav Trmač of Red Hat.
This issue affects the versions of the libuser package, as shipped with Red Hat Enterprise Linux 5 and 6. -- This issue affects the versions of the libuser package, as shipped with Fedora release of 16 and 17.
This issue was assigned CVE-2012-5644
Created libuser tracking bugs for this issue Affects: fedora-all [bug 928846]
CVE-2012-5630 and CVE-2012-5644 were addressed upstream via the following set of commits (This also includes a some code refactoring, functionality changes and some minor cleanups): https://fedorahosted.org/libuser/changeset?reponame=&old=cd5a8babd110b138d40fe0d51da2e7d18069eca6%40&new=4a8a1c1c5cf4611bfbdb5d23b51b1a4110112b97%40 https://fedorahosted.org/libuser/changeset?reponame=&old=ae3646e9ed8acea5aa64b4c35f8e2e015696093c%40&new=d094070cab7f717a5d2b17bde0a4795fab9d7239%40 Minimal backport to fedora version of libuser avoiding other code cleanups: http://pkgs.fedoraproject.org/cgit/libuser.git/tree/libuser-dirtree-TOCTOU-fix.patch?id=78a55bf498cac0b430ba6512654860c39dfd0bf9
Statement: Red Hat Product Security has rated this issue as having Low security impact. This issue is not currently planned to be addressed in future updates. For additional information, refer to the Issue Severity Classification: https://access.redhat.com/security/updates/classification/.
Is there any steps for mitigation that we can apply for a workaround? Also share steps for reproduction.
(In reply to Sonu Khan from comment #11) > Is there any steps for mitigation that we can apply for a workaround? > Also share steps for reproduction. I don’t think we typically share reproducers, anyway please contact Product Security at secalert .
Mitigation: There are several restrictions to successful exploitation of this flaw: ~~~ 1. ONLY applications compiled with libuser are affected. The affected code is hit only when a move operation is conducted on user home directory. 2. The attacker needs to have a shell account on the target machine. 3. Since this is a TOCTOU attack, precise timing is required for the attack. The attacker needs to know exactly when the move directory is moved in order successfully exploit this flaw. ~~~ Any other application acting on user directories (not compiled with libuser) for example usermod/userdel are not affected by this flaw.