Summary | Audit for inappropriate use of mt_rand() |
Queue | Horde Base |
Queue Version | Git master |
Type | Bug |
State | Assigned |
Priority | 2. Medium |
Owners | Horde Developers (at) , chuck (at) horde (dot) org |
Requester | chuck (at) horde (dot) org |
Created | 10/07/2008 (6063 days ago) |
Due | |
Updated | 10/16/2012 (4593 days ago) |
Assigned | |
Resolved | |
Milestone | |
Patch | No |
I'd have to do some research to be sure, though.
the salt, unless a seed is specified. What I don't get is, why we
sometimes hash mt_rand() directly, and sometimes 2 or 3 calls to
mt_rand(), converted to hex strings?
use Horde_Support_Randomid everywhere. We can always improve that in
a single place if necessary then.
use Horde_Support_Randomid everywhere. We can always improve that in a
single place if necessary then.
Gollem_Api::setSelectlist()
intended to create non-colliding identifiers.
application or host is using the same temp directory. But like I said,
this is really picky.
Gollem_Api::setSelectlist()
intended to create non-colliding identifiers.
Summary ⇒ Audit for inappropriate use of mt_rand()
source of randomness? /dev/urandom is not available on all systems.
Our pre-generated secret_key doesn't change.
In Horde_Support we use:
- php_uname('n') 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'm unsure about:
Kolab_Storage
Only if being anal for:
Horde_Form_Type_image::getRandomId()
Horde_Util::createTempDir()
Gollem_Api::setSelectlist()
Milestone ⇒ 4
New Attachment: mt_rand.txt
likely not all of them are; these are the ones I wasn't able to filter
out without looking at context.
Milestone ⇒
State ⇒ Assigned
Patch ⇒ No
Assigned to
Assigned to Chuck Hagenbuch
Queue ⇒ Horde Base
Summary ⇒ Audit for innappropriate use of mt_rand
Type ⇒ Bug
Priority ⇒ 2. Medium
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/