Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 81521 - dev-perl/Net-SSLeay Insecure entropy source in Net::SSLeay (CAN-2005-0106) (Vendor-Sec)
Summary: dev-perl/Net-SSLeay Insecure entropy source in Net::SSLeay (CAN-2005-0106) (V...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Security
Classification: Unclassified
Component: Vulnerabilities (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Gentoo Security
URL:
Whiteboard: A3? [preebuild] koon CONFIDENTIAL 200...
Keywords:
Depends on:
Blocks:
 
Reported: 2005-02-10 11:06 UTC by Sune Kloppenborg Jeppesen (RETIRED)
Modified: 2007-11-03 21:53 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ssleay.diff (ssleay.diff,1.13 KB, patch)
2005-02-10 11:07 UTC, Sune Kloppenborg Jeppesen (RETIRED)
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-02-10 11:06:04 UTC
Javier Fern
Comment 1 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-02-10 11:06:04 UTC
Javier Fernández-Sanguino Peña wrote:

While doing a source code audit for /tmp usage in Debian packages which
might pose a security issue I've found this code snippet in Net::SSleay
(libnet-ssleay-perl in Debian which ships both versions 1.08-1 and 1.25-1)
which I'm slightly worried about:

   1852 sub randomize (;$$) {
(...)
   1856     $egd_path = $ENV{'EGD_PATH'} if $ENV{'EGD_PATH'};
   1857     $egd_path = '/tmp/entropy'   unless $egd_path;

Now, besides the fact that Debian does not provide EGD [1], what would be
the consequences to applications ussing this perl module if, at the same
time, a rogue local user created a '/tmp/entropy' socket that did not
provide proper entropy? OpenSSL (as far as I have seen, in
crypto/rand/rand_egd.c) will not do any checks on the file provided as a
path to RAND_query_egd_bytes() (I'm not sure if it should do any, however)

I don't think that /tmp/entropy should be used if EGD_PATH is undefined
since it seems like a possible venue of attack (similarly. I'm not sure if
it would be possible or if it would have any reasonable impact but IMHO
line 1857 should be removed from the code. Shouldn't it?

If you all agree with the above, would be the attached patch a proper fix?

Sampo Kellomaki <sampo@iki.fi> (upstream) added:

Well, perhaps, but you need to understand that I aim supporting
platforms other than Linux. Solaris 2.6 for example does not have
/dev/urandom (which in itself is a security problem as well when
you have entropy depletion, but even Linux vendors seem to be
happy to ignore that) and therefore you are expected to install
EGD or prngd (both of which can even be installed on Linux, BTW).

Now the mechanics of that statement may in particular wrong and
the right solution probably would be to add EGD as a dependency check
in perl Makefile.pl. However, since I have limited resources
to answer questions or develop ultra sophisticated configuration
scripts that still need to be debugged etc., thus I just kludged
it that way to silence the barrage of newbie email.

[..]

If you patch it, please make sure Solaris 2.6 continues to be supported
and the case where EGD or prngd is missing is fixed such that I do not
get newbie mail.

[..]

Thank you. Since it is a vulnearability and since no fix
is forthcoming in short time period it should be disclosed
immediately so that the affected know and can make their
judgements.

Hence, we're going to update the package next week with the attached
patch.
Comment 2 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-02-10 11:07:45 UTC
Created attachment 50933 [details, diff]
ssleay.diff

Debian patch.
Comment 3 Sune Kloppenborg Jeppesen (RETIRED) gentoo-dev 2005-02-13 06:01:13 UTC
Micheal please be ready to bump.
Comment 4 Thierry Carrez (RETIRED) gentoo-dev 2005-02-13 10:02:08 UTC
I am not too sure about this one. Do we provide EGD ?
Comment 5 Michael Cummings (RETIRED) gentoo-dev 2005-02-17 10:15:43 UTC
No such beast in our tree (EGD that is) - it's a perl implementation to mimic /dev/random for systems that don't have one (http://egd.sourceforge.net/) - but since in Gentoo land we all have one (and those ports of portage folks -  mac and bsd - haven't said anything if they don't) it hasn't/isn't an issue. I'd say this is nice, but not applicable.
Comment 6 Thierry Carrez (RETIRED) gentoo-dev 2005-02-18 01:17:34 UTC
I suppose we should close this one as INVALID then. Anyone can reopen if they disagree on us being unaffected.