Changeset 3955 in subversion


Ignore:
Timestamp:
Sep 10, 2010 4:09:10 AM (3 years ago)
Author:
alec
Message:
  • Security improvements for chpasswd driver (#1486987)
Location:
trunk/plugins/password
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/plugins/password/README

    r3954 r3955  
    224224 the 'chpasswd' command. See config.inc.php file. 
    225225 
     226 Attached wrapper script (chpass-wrapper.py) restricts password changes 
     227 to uids >= 1000 and can deny requests based on a blacklist. 
     228 
    226229 
    227230 2.12.  LDAP - no PEAR (ldap_simple) 
  • trunk/plugins/password/drivers/chpasswd.php

    r3533 r3955  
    1212 * @author Alex Cartwright <acartwright@mutinydesign.co.uk) 
    1313 */ 
    14   
     14 
    1515function password_save($currpass, $newpass) 
    1616{ 
    17     $cmd = sprintf('echo \'%1$s:%2$s\' | %3$s; echo $?', 
    18                 addcslashes($_SESSION['username'], "'"), 
    19                 addcslashes($newpass, "'"), 
    20                 rcmail::get_instance()->config->get('password_chpasswd_cmd')); 
     17    $cmd = rcmail::get_instance()->config->get('password_chpasswd_cmd'); 
     18    $username = $_SESSION['username']; 
    2119 
    22     if (exec($cmd) == 0) { 
     20    $handle = popen($cmd, "w"); 
     21    fwrite($handle, "$username:$newpass"); 
     22 
     23    if (pclose($handle) == 0) { 
    2324        return PASSWORD_SUCCESS; 
    2425    } 
     
    3435    return PASSWORD_ERROR; 
    3536} 
    36  
    37 ?> 
  • trunk/plugins/password/package.xml

    r3954 r3955  
    1616                <active>yes</active> 
    1717        </lead> 
    18         <date></date> 
    19         <time></time> 
     18        <date>2010-09-10</date> 
     19        <time>09:00:00</time> 
    2020        <version> 
    2121                <release>1.7</release> 
     
    2929        <notes> 
    3030- Added XMail driver 
     31- Improve security of chpasswd driver using popen instead of exec+echo (#1486987) 
     32- Added chpass-wrapper.py script to improve security (#1486987) 
    3133    </notes> 
    3234        <contents> 
     
    8284            <file name="drivers/virtualmin.php" role="php"></file> 
    8385            <file name="drivers/ximss.php" role="php"></file> 
     86            <file name="drivers/xmail.php" role="php"></file> 
     87            <file name="drivers/chpass-wrapper.py" role="data"></file> 
    8488 
    8589            <file name="config.inc.php.disc" role="data"></file> 
Note: See TracChangeset for help on using the changeset viewer.