Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 156371 - Insecure key generation
Summary: Insecure key generation
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: system-config-network
Version: 4.0
Hardware: All
OS: Linux
Target Milestone: ---
: ---
Assignee: Harald Hoyer
QA Contact:
Whiteboard: impact=low,public=20050429,source=sec...
Depends On:
Blocks: 168429
TreeView+ depends on / blocked
Reported: 2005-04-29 14:44 UTC by Josh Bressers
Modified: 2007-11-30 22:07 UTC (History)
2 users (show)

Fixed In Version: RHBA-2006-0094
Doc Type: Bug Fix
Doc Text:
Clone Of:
Last Closed: 2006-03-07 18:38:34 UTC
Target Upstream Version:

Attachments (Terms of Use)

System ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2006:0094 qe-ready SHIPPED_LIVE system-config-network bug fix update 2006-03-06 05:00:00 UTC

Description Josh Bressers 2005-04-29 14:44:19 UTC
These issues were reported to by David Martin.

- If you click the "generate keys" button in
system-config-network-gui (rhel 4), as seems the
prudent thing to do, then it generates 24
bytes/characters of key for the connection.  At 8
bits/byte that's 24*8=192 bits, which is appropriate
for 3-key 3DES keys.  But each of these 24 characters
is chosen from [0-9a-f], so each char only contains 4
bits of information -- and those 24 characters only
result in a key that has 24*4=96 bits of entropy, half
of the desired amount, and also 16 bits less than the
standard minimum 112 bits for 3DES.

- The same utility appears to use the same keys in both
directions of the connection, even though it assigns
them different SPIs.  Using the same key for multiple
directions in a connection is well known to lead to
simple cut-and-paste attacks and other vulnerabilities.

- Presumably for ease of configuration, the utilities
derive the SPIs from the keys themselves.  But these
SPIs leak information about the keys.  Here's an line
from the Python code that generates the SPIs:

conf["SPI_AH_IN"]   = str(zlib.crc32(self.AHKey  +
"IN",  0) & 0x7FFFFFFF)

CRC32 is *not* a one-way function.  The resulting SPI
contains a lot of information about the key it refers
to.  And SPIs are transmitted in cleartext in IPsec.
I'm not sure exactly how many bits this leaks, but
combined with the inherent weakness of the keys above,
this could well lead to a practical procedure for
extracting keys from active connections -- one that
would succeed in the order of days rather than millenia.

Again, these problems are all in the Red Hat
configuration utilities.  IPsec is horribly complicated
so it's natural that administrators will lean on your
configuration utilities to set things up.  There is a
moment of reprieve here in that because the SPI IN/OUT
thing is broken, there probably aren't many vulnerable
connections actually being used.  So when you address
that problem, please make sure you fix these security
weaknesses too.

Comment 1 Josh Bressers 2005-04-29 14:48:30 UTC

Do you know if these issues affect anything other than RHEL4?

Comment 2 David Martin 2005-04-29 15:10:49 UTC
(In reply to comment #1)
> Harald,
> Do you know if these issues affect anything other than RHEL4?

These problems are also in RHEL3.

Comment 3 Harald Hoyer 2005-04-29 15:16:47 UTC
yes, RHEL3.. should fix that, though ipsec setup via GUI doesn't work anyway
because of other bugs :-/

Comment 4 Harald Hoyer 2005-09-09 14:13:12 UTC
Does this version fix your problems?

Comment 6 Mark J. Cox 2005-10-31 09:16:32 UTC
Added to U3Proposed; this should get fixed for U7 at the latest.

Comment 11 Josh Bressers 2005-12-01 15:40:10 UTC
I have filed bug 174699 which is the placeholder for this issue as it exists in

Comment 13 Red Hat Bugzilla 2006-03-07 18:38:35 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

Note You need to log in before you can comment on or make changes to this bug.