oss-sec mailing list archives

Re: expat hash collision fix too predictable?


From: Kurt Seifried <kseifried () redhat com>
Date: Thu, 05 Apr 2012 11:32:09 -0600

On 04/05/2012 03:30 AM, Marcus Meissner wrote:
Hi,

while reviewing a expat regression (likely caused by the hash collision denial of service fix, but unclear)
i stumbled about the randomness it uses.

      static unsigned long
      generate_hash_secret_salt(void)
      {
        unsigned int seed = time(NULL) % UINT_MAX;
        srand(seed);
        return rand();
      }

and it is seeded once at parser object creation.

This is better than not seeding, but I am not sure if it is sufficient.

Ciao, Marcus

Something to remember, this doesn't have to be cryptographically strong,
just good enough to make pre-compute attacks costly enough to prevent
them. With this instead of pre-computing one file and sending it
multiple times you'd have to pre-compute a file for each attack.
Additionally with the time constraint you'd have to send the XML in and
have it hit the array creation stage with the exact same time, which
would be tricky for most cases.

-- 
Kurt Seifried Red Hat Security Response Team (SRT)
PGP: 0x5E267993 A90B F995 7350 148F 66BF 7554 160D 4553 5E26 7993


Current thread: