RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 815516 - pam remember can check wrong username if it is a substring of another username
Summary: pam remember can check wrong username if it is a substring of another username
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: pam
Version: 6.3
Hardware: i386
OS: Linux
unspecified
medium
Target Milestone: rc
: 6.4
Assignee: Tomas Mraz
QA Contact: Dalibor Pospíšil
URL:
Whiteboard:
Depends On:
Blocks: 836160
TreeView+ depends on / blocked
 
Reported: 2012-04-23 18:40 UTC by Tomas Mraz
Modified: 2013-02-21 10:36 UTC (History)
3 users (show)

Fixed In Version: pam-1.1.1-12.el6
Doc Type: Bug Fix
Doc Text:
Cause: The pam_unix remember option functionality incorrectly matched user names in the /etc/security/opasswd file. Consequence: Users with their user name being a prefix of another user name could sometimes get incorrectly restricted with passwords of the other user when changing their password or overwrite old passwords of the other user account. Fix: The pam_unix module was fixed to properly match the whole user name when looking up records in /etc/security/opasswd file. Result: Users are now correctly restricted with their own old passwords and old password records of another user are no longer overwritten.
Clone Of: 768087
Environment:
Last Closed: 2013-02-21 10:36:56 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2013:0521 0 normal SHIPPED_LIVE Moderate: pam security, bug fix, and enhancement update 2013-02-20 21:28:50 UTC

Description Tomas Mraz 2012-04-23 18:40:07 UTC
+++ This bug was initially created as a clone of Bug #768087 +++

Description of problem:
The remember functionality of pam_unix can compare against the wrong username’s old passwords if the username is a substring of another username.  The substring must be at the beginning of both usernames for this to occur.  For example, a username ‘test’ will look at the old passwords of ‘test123’.

Version-Release number of selected component (if applicable):
pam-0.99.6.2-6.el5_5.2.i386.rpm

How reproducible:
Always

Steps to Reproduce:
1.  Make sure remember=8 or something similar is enabled on pam_unix in the password stack
2.  Create a user ‘test1’ and change the password a few times
3.  Create a user ‘test’ and change the password to a previous password of test1

  
Actual results:
The password change is denied, however, it should not have been.

Expected results:
The password change is allowed.

Additional info:

You can see the erroneous code in pam_unix_passwd.c inside of the pam_unix module directory (in function save_old_password):

    while (fgets(buf, 16380, opwfile)) {
    if (!strncmp(buf, forwho, strlen(forwho))) {

The fix is to search for a line that starts with the username followed immediately by a colon.  


The same erroneous code exists in "pam_unix_passwd.c" in function check_old_password:

    while (fgets(buf, 16380, opwfile)) {
        if (!strncmp(buf, forwho, strlen(forwho))) {

Comment 4 errata-xmlrpc 2013-02-21 10:36:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHSA-2013-0521.html


Note You need to log in before you can comment on or make changes to this bug.