Search This Blog

Tuesday, September 27, 2005

[NT] SecureW2 Weak Random Seeding for PMS

The following security advisory is sent to the securiteam mailing list, and can be found at the SecuriTeam web site: http://www.securiteam.com
- - promotion

The SecuriTeam alerts list - Free, Accurate, Independent.

Get your security news from a reliable source.
http://www.securiteam.com/mailinglist.html

- - - - - - - - -

SecureW2 Weak Random Seeding for PMS
------------------------------------------------------------------------

SUMMARY

<http://www.securew2.com/uk/> SecureW2 - "powerful open source EAP-TTLS
Client for Windows."

SecureW2 uses weak random number seeding when it generates the PMS (Pre
Master Secret).

DETAILS

Vulnerable Systems:
* SecureW2 versions 3.0 and prior

SecureW2 uses weak random numbers when generating the pre-master-secret.

Vulnerable code:
The code quoted below can be found in
"./Components/Common/release3/version 0/source/CommonTLS.c":
//
// Name: TLSGenPMS
// Description: Generate the 48 random bytes for the PMS (Pre Master
Secret)
// Author: Tom Rixom
// Created: 17 December 2002
//
DWORD
TLSGenPMS( IN OUT BYTE pbPMS[TLS_PMS_SIZE] )
{
int i = 0;
SYSTEMTIME SystemTime;
DWORD dwRet;

dwRet = NO_ERROR;

AA_TRACE( ( TEXT( "TLSGenPMS" ) ) );

pbPMS[0] = 0x03;
pbPMS[1] = 0x01;

//
// Time (DWORD)
//
GetLocalTime( &SystemTime );

srand( ( unsigned int ) SystemTime.wMilliseconds );

//srand( ( unsigned )time( NULL ) );

//
// Random bytes
//
for( i=2; i < TLS_PMS_SIZE; i++ )
pbPMS[i] = ( BYTE ) ( rand() % 255 );

AA_TRACE( ( TEXT( "TLSGenPMS::random bytes: %s" ), AA_ByteToHex(
pbPMS, TLS_PMS_SIZE ) ) );

return dwRet;
}

It appear to be using the weak srand/rand functions seeded by the
milliseconds field from the system clock. That doesn't provide you with
48 bytes of strong randomness, you are lucky to get even a few bytes.

ADDITIONAL INFORMATION

The information has been provided by <mailto:jas@extundo.com> Simon
Josefsson.

========================================

This bulletin is sent to members of the SecuriTeam mailing list.
To unsubscribe from the list, send mail with an empty subject line and body to: list-unsubscribe@securiteam.com
In order to subscribe to the mailing list, simply forward this email to: list-subscribe@securiteam.com

====================
====================

DISCLAIMER:
The information in this bulletin is provided "AS IS" without warranty of any kind.
In no event shall we be liable for any damages whatsoever including direct, indirect, incidental, consequential, loss of business profits or special damages.

No comments: