<?xml version="1.0" encoding="UTF-8"?> 
<?xml-stylesheet href="https://dev.horde.org/themes/horde//default/feed-rss.xsl" type="text/xsl"?> 
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
 <channel> 
  <title>Audit for inappropriate use of mt_rand()</title> 
  <pubDate>Thu, 09 Apr 2026 17:14:42 +0000</pubDate> 
  <link>https://bugs.horde.org/ticket/7447</link> 
  <atom:link rel="self" type="application/rss+xml" title="Audit for inappropriate use of mt_rand()" href="https://bugs.horde.org/ticket/7447/rss" /> 
  <description>Audit for inappropriate use of mt_rand()</description> 
 
   
   
  <item> 
   <title>Shouldn&#039;t use mt_rand on its own to generate a key for a pas</title> 
   <description>Shouldn&#039;t use mt_rand on its own to generate a key for a password reset or a new password or anything else that could be exploited:

http://www.suspekt.org/2008/08/17/mt_srand-and-not-so-random-numbers/</description> 
   <pubDate>Tue, 07 Oct 2008 20:06:34 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t49498</link> 
  </item> 
   
  <item> 
   <title>These are the calls in HEAD that are potentially of concern.</title> 
   <description>These are the calls in HEAD that are potentially of concern. Most likely not all of them are; these are the ones I wasn&#039;t able to filter out without looking at context.</description> 
   <pubDate>Mon, 10 Nov 2008 05:35:03 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t50643</link> 
  </item> 
   
  <item> 
   <title>I can confirm the imp/mimp calls are fine.</title> 
   <description>I can confirm the imp/mimp calls are fine.</description> 
   <pubDate>Wed, 03 Dec 2008 23:40:57 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t51064</link> 
  </item> 
   
  <item> 
   <title>The question is, what else to we use (additionally?) as a se</title> 
   <description>The question is, what else to we use (additionally?) as a secret or source of randomness? /dev/urandom is not available on all systems. Our pre-generated secret_key doesn&#039;t change.
In Horde_Support we use:
- php_uname(&#039;n&#039;) or ip address (not random, only to avoid collisions)
- uniqid() (with the more-entropy parameter a good candidate)
- zend_thread_id()/getmypid() (short)
- microtime() (predictable)

Horde_Oauth and Horde_Token use microtime() resp. time() for Nonces.

This needs to applied to:
Horde_Auth::getSalt(), genRandomPassword() (salt and password generation)
Horde_ActiveSync_State_Base::generatePolicyKey()
Horde_Secret::setKey()
Shout::genDeviceAuth()

And probably to share and object ids and resources too, since they could be used to share hidden shares/objects through a secret url:
Horde_Core_Imsp_Utils::synchShares()
Kronolith_Resource::addResource()
Turba_Driver::_makeKey()

I&#039;m unsure about:
Kolab_Storage

Only if being anal for:
Horde_Form_Type_image::getRandomId()
Horde_Util::createTempDir()
Gollem_Api::setSelectlist()</description> 
   <pubDate>Thu, 31 Mar 2011 23:36:44 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t62930</link> 
  </item> 
   
  <item> 
   <title>&gt; Horde_Util::createTempDir()
&gt; Gollem_Api::setSelectlist()</title> 
   <description>&gt; Horde_Util::createTempDir()
&gt; Gollem_Api::setSelectlist()

These have nothing to do with security AFAIK - they are simply intended to create non-colliding identifiers.</description> 
   <pubDate>Fri, 01 Apr 2011 19:05:21 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t62985</link> 
  </item> 
   
  <item> 
   <title>&gt;&gt; Horde_Util::createTempDir()
&gt;&gt; Gollem_Api::setSelectlist</title> 
   <description>&gt;&gt; Horde_Util::createTempDir()
&gt;&gt; Gollem_Api::setSelectlist()
&gt;
&gt; These have nothing to do with security AFAIK - they are simply 
&gt; intended to create non-colliding identifiers.

It could theoretically be used for information leakage if another application or host is using the same temp directory. But like I said, this is really picky.</description> 
   <pubDate>Fri, 01 Apr 2011 19:54:06 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t62987</link> 
  </item> 
   
  <item> 
   <title>Any opinions how to generate more random keys best? I tend t</title> 
   <description>Any opinions how to generate more random keys best? I tend to simply use Horde_Support_Randomid everywhere. We can always improve that in a single place if necessary then.</description> 
   <pubDate>Mon, 04 Apr 2011 12:13:25 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t63083</link> 
  </item> 
   
  <item> 
   <title>&gt; Any opinions how to generate more random keys best? I tend</title> 
   <description>&gt; Any opinions how to generate more random keys best? I tend to simply 
&gt; use Horde_Support_Randomid everywhere. We can always improve that in 
&gt; a single place if necessary then.

This seems like the correct thing to do.</description> 
   <pubDate>Mon, 04 Apr 2011 18:24:59 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t63118</link> 
  </item> 
   
  <item> 
   <title>In Horde_Auth::getSalt(), we always use an MD5 hash as the b</title> 
   <description>In Horde_Auth::getSalt(), we always use an MD5 hash as the basis for the salt, unless a seed is specified. What I don&#039;t get is, why we sometimes hash mt_rand() directly, and sometimes 2 or 3 calls to mt_rand(), converted to hex strings?</description> 
   <pubDate>Mon, 04 Apr 2011 22:04:12 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t63137</link> 
  </item> 
   
  <item> 
   <title>Anyone?</title> 
   <description>Anyone?</description> 
   <pubDate>Tue, 19 Apr 2011 16:24:02 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t63928</link> 
  </item> 
   
  <item> 
   <title>I think it has to do with how much random input the salt is </title> 
   <description>I think it has to do with how much random input the salt is expecting. I&#039;d have to do some research to be sure, though.</description> 
   <pubDate>Wed, 20 Apr 2011 02:48:10 +0000</pubDate> 
   <link>https://bugs.horde.org/ticket/7447#t63972</link> 
  </item> 
   
   
 
 </channel> 
</rss> 
