Bug 174699 - Insecure key generation
Insecure key generation
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: system-config-network (Show other bugs)
All Linux
medium Severity low
: ---
: ---
Assigned To: Harald Hoyer
: Security
Depends On:
  Show dependency treegraph
Reported: 2005-12-01 10:39 EST by Josh Bressers
Modified: 2012-06-20 12:09 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2012-06-20 12:09:13 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Josh Bressers 2005-12-01 10:39:14 EST
+++ This bug was initially created as a clone of Bug #156371 +++

These issues were reported to secalert@redhat.com 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 Jiri Pallich 2012-06-20 12:09:13 EDT
Thank you for submitting this issue for consideration in Red Hat Enterprise Linux. The release for which you requested us to review is now End of Life. 
Please See https://access.redhat.com/support/policy/updates/errata/

If you would like Red Hat to re-consider your feature request for an active release, please re-open the request via appropriate support channels and provide additional supporting details about the importance of this issue.

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