fix proposed Re: misc/43674: Able to bypass expired password

Dorr H. Clark dclark at applmath.scu.edu
Thu May 1 18:00:26 PDT 2003


The following reply was made to PR misc/43674; it has been noted by GNATS.

From: "Dorr H. Clark" <dclark at applmath.scu.edu>
To: freebsd-gnats-submit at FreeBSD.org,
	crawford.jeffrey.eugene at bigfoot.com
Cc:  
Subject: fix proposed Re: misc/43674: Able to bypass expired password
Date: Thu, 01 May 2003 17:57:12 -0700

 The problem in 43674 occurs because the implementation 
 presumes the cooperation of the user, which is normally 
 a sub-optimal strategy for system security.  
 If the user chooses not to cooperate, login is not aware.  
 
 Our proposed fix checks whether the user has actually made 
 the requested password change before proceeding.  
 If they attempt the ^C exploit listed in 43674, 
 they are prompted again.
 
 NOTE:  This patch is compatible with 4.7-STABLE !
 
 --- /usr/src/usr.bin/login/login.c      Wed Mar 13 10:45:33 2002
 +++ login.c     Mon Apr 28 20:45:24 2003
 @@ -704,12 +704,15 @@
         (void)signal(SIGQUIT, SIG_DFL);
         (void)signal(SIGINT, SIG_DFL);
         (void)signal(SIGTSTP, SIG_IGN);
 -
 -       if (changepass) {
 +       while (changepass) {
                 if (system(_PATH_CHPASS) != 0)
                         sleepexit(1);
 +               pwd = getpwnam(username);
 +               if(!pwd->pw_change)
 +                       changepass = 0;
 +               else
 +                       printf("\nSorry!Your password is expired.You
 have to
 enter a new password.\n\n");
         }
 -
         /*
          * Login shells have a leading '-' in front of argv[0]
          */
 
 Kuang-Wu "Kerwin" Hsu, engineer
 Dorr H. Clark, advisor
 COEN 284 - Operating Systems Case Study 
 Santa Clara University, 
 Santa Clara CA.


More information about the freebsd-bugs mailing list