Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 6 Apr 2017 10:32:45 +0200
From: Hanno Böck <hanno@...eck.de>
To: oss-security@...ts.openwall.com
Subject: Re: libxslt math.random issue

Hi,

On Thu, 6 Apr 2017 07:44:00 +0200
Marcus Meissner <meissner@...e.de> wrote:

> CVE-2015-9019 has been assigned to use of libexslt (in libxslt) usage
> of "math.random" without initializing the randomseed.
> 
> https://bugzilla.gnome.org/show_bug.cgi?id=758400
> https://bugzilla.suse.com/show_bug.cgi?id=934119

I have some questions and comments:

1. What's the use of the random number and what's the security impact
if it's not random? That's not explained
In case of the bugreport.
In case a cryptographically secure random number is required then using
rand()/srand() is a bad idea anyway.
(Unfortunately there's no secure random in the standard libc, but at
least glibc now has getrandom.).

2. This part of the patch looks a bit strange:

+	seed = time(NULL); /* just in case /dev/urandom is not there */
+	if (fd == -1) {
+		read (fd, &seed, sizeof(seed));
+		close (fd);
+	}

You're calling time() unconditionally, although it's kinda just a
fallback. Why not
+	if (fd == -1) {
+		read (fd, &seed, sizeof(seed));
+		close (fd);
+	} else {
+		seed = time(NULL);
+	}
?

(obviously using time is not a secure way to do random numbers, if
secure numbers are required cross-plattform you need to do this
otherwise anyway)


-- 
Hanno Böck
https://hboeck.de/

mail/jabber: hanno@...eck.de
GPG: FE73757FA60E4E21B937579FA5880072BBB51E42

Powered by blists - more mailing lists

Please check out the Open Source Software Security Wiki, which is counterpart to this mailing list.

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.