The shell escaping fix in map_yp_alias (CVE-2009-1579) was incomplete.
authorkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 21 May 2009 17:11:22 +0000 (17:11 +0000)
committerkink <kink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Thu, 21 May 2009 17:11:22 +0000 (17:11 +0000)
Thanks Michal Hlavinka for noticing this. [CVE-2009-1381]

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@13734 7612ce4b-ef26-0410-bec9-ea0150e637f0

doc/ChangeLog
functions/imap_general.php

index d9efb56cc40534868109f08b0646ce4a23494642..4eb9f53f0fb7475996a2a197e58ccad90e896d70 100644 (file)
@@ -304,7 +304,8 @@ Version 1.5.2 - SVN
     also includes general cleanup of that page (Thanks to Niels Teusink).
     [also CVE-2009-1578]
   - Fixed unsanitized shell command in example IMAP username mapping
-    function (map_yp_alias) (Thanks to Niels Teusink). [CVE-2009-1579]
+    function (map_yp_alias) (Thanks to Niels Teusink).
+    [CVE-2009-1579, CVE-2009-1381]
   - Fixed session fixation issues where someone who can modify a user's
     cookies could gain control of their login session.  The SquirrelMail
     base URI is now uniformly generated, extraneous cookies are cleaned
index 0121a21002998256607debe03972ddde0b685199..2b0b0cf67620d37756f6d3117b8fdc049413ecd0 100755 (executable)
@@ -1436,6 +1436,7 @@ function sqimap_get_user_server ($imap_server, $username) {
  * @since 1.3.0
  */
 function map_yp_alias($username) {
-   $yp = `ypmatch ' . escapeshellarg($username) . ' aliases`;
+   $safe_username = escapeshellarg($username);
+   $yp = `ypmatch $safe_username aliases`;
    return chop(substr($yp, strlen($username)+1));
 }