|
|
Subscribe / Log in / New account

Security

On entropy and randomness

By Jake Edge
December 12, 2007

Linux random number generation (RNG) is often a source of confusion to developers, but it is also a very integral part of the security of the system. It provides random data to generate cryptographic keys, TCP sequence numbers, and the like, so unpredictability as well as very strong random numbers are required. When someone notices a flaw, or a possible flaw in the RNG, kernel hackers take notice.

Recurring universally unique identifiers (UUIDs), as reported by the smolt hardware profiler client program, had some worried about problems in the kernel RNG. As it turns out, the problem exists in the interaction between Fedora 8 LiveCD installations and smolt – essentially the UUID came from the CD – but it sparked a discussion leading to some possible improvements. Along the way, some common misconceptions about kernel RNG were cleared up.

The kernel gathers information from external sources to provide input to its entropy pool. This pool contains bits that have extremely strong random properties, so long as unpredictable events (inter-keypress timings, mouse movements, disk interrupts, etc.) are sampled. It provides direct access to this pool via the /dev/random device. Reading from that device will provide the strongest random numbers that Linux can offer – depleting the entropy pool. When the entropy pool runs low, reads to /dev/random block until there is sufficient entropy.

The alternative interface, the one that nearly all programs should use, is /dev/urandom. Reading from that device will not block. If sufficient entropy is available, it will provide random numbers just as strong as /dev/random, if not, it uses the SHA cryptographic hash algorithm to generate very strong random numbers. Developers often overestimate how strong their random numbers need to be; they also overestimate how easy "breaking" /dev/urandom would be, which leads to programs that, unnecessarily, read /dev/random. Ted Ts'o, who wrote the kernel RNG, puts it this way:

Past a certain point /dev/urandom will start returning results which are cryptographically random. At that point, you are depending on the strength of the SHA hash algorithm, and actually being able to not just to find hash collisions, but being able to trivially find all or most possible pre-images for a particular SHA hash algorithm. If that were to happen, it's highly likely that all digital signatures and openssh would be totally broken.

There is still a bit of hole in all of this: how does a freshly installed system, with little or no user interaction, at least yet, get its initial entropy? When Alan Cox and Mike McGrath started describing the smolt problem, the immediate reaction was to look closely at how the entropy pool was being initialized. While that turned out not to be the problem, it did lead Matt Mackall, maintainer of the kernel RNG, to start thinking about better pool initialization. Various ideas about mixing in data specific to the host, like MAC address and PCI device characteristics were discussed.

As Ts'o points out, that will help prevent things like UUID collisions, but it doesn't solve the problem of predictability of the random numbers that will be generated by these systems.

In order to do that we really do need to improve the amount of hardware entropy we can mix into the system. This is a hard problem, but as more people are relying on these facilities, it's something we need to think about quite a bit more!

Linux provides random numbers suitable for nearly any purpose via /dev/urandom. For the truly paranoid, there is also /dev/random, but developers would do well to forget that device exists for everything but the most critical needs. If one is generating a large key pair, to use for the next century, using some data from /dev/random is probably right. Anything with lower requirements should seriously consider /dev/urandom.

Comments (28 posted)

New vulnerabilities

autofs: insecure default configuration

Package(s):autofs CVE #(s):CVE-2007-5964
Created:December 12, 2007 Updated:January 14, 2008
Description: Versions of the autofs automounter daemon as shipped by Red Hat (and possibly other distributors) are installed with an insecure configuration; in particular, the "hosts" map lacks the "nosuid" option, allowing an attacker who has control over an NFS server to run setuid programs on vulnerable systems.
Alerts:
Mandriva MDVSA-2008:009-1 autofs 2007-01-12
Mandriva MDVSA-2008:009 autofs 2007-01-11
Fedora FEDORA-2007-4707 autofs 2007-12-21
Fedora FEDORA-2007-4469 autofs 2007-12-15
Fedora FEDORA-2007-4532 autofs 2007-12-15
Red Hat RHSA-2007:1129-01 autofs5 2007-12-12
Fedora FEDORA-2007-4709 autofs 2007-12-21
Red Hat RHSA-2007:1128-01 autofs 2007-12-12

Comments (none posted)

e2fsprogs: integer overflows

Package(s):e2fsprogs CVE #(s):CVE-2007-5497
Created:December 7, 2007 Updated:February 12, 2008
Description: Rafal Wojtczuk of McAfee AVERT Research discovered that e2fsprogs, ext2 file system utilities and libraries, contained multiple integer overflows in memory allocations, based on sizes taken directly from filesystem information. These could result in heap-based overflows potentially allowing the execution of arbitrary code.
Alerts:
Foresight FLEA-2008-0005-1 e2fsprogs 2008-02-11
Fedora FEDORA-2007-4447 e2fsprogs 2008-01-16
Fedora FEDORA-2007-4461 e2fsprogs 2008-01-16
Red Hat RHSA-2008:0003-01 e2fsprogs 2008-01-07
Gentoo 200712-13 e2fsprogs 2007-12-18
rPath rPSA-2007-0262-1 e2fsprogs 2007-12-11
Debian DSA-1422 e2fsprogs 2007-12-07
Mandriva MDKSA-2007:242 e2fsprogs 2007-12-10
Ubuntu USN-555-1 e2fsprogs 2007-12-08

Comments (none posted)

emacs: buffer overflow

Package(s):emacs CVE #(s):CVE-2007-6109
Created:December 10, 2007 Updated:May 6, 2008
Description:

From the National Vulnerability Database:

Buffer overflow in emacs allows attackers to have an unknown impact, as demonstrated via a vector involving the command line.

Alerts:
Ubuntu USN-607-1 emacs21, emacs22 2008-05-06
SuSE SUSE-SR:2008:003 java, nss_ldap, cairo, geronimo, moodle, SDL_image, python, mysql, nx, xemacs 2008-02-07
Mandriva MDVSA-2008:034 emacs 2007-02-04
Gentoo 200712-03 emacs 2007-12-09

Comments (none posted)

emul-linux-x86-qtlibs: arbitrary code execution

Package(s):emul-linux-x86-qtlibs CVE #(s):
Created:December 10, 2007 Updated:December 12, 2007
Description:

From the Gentoo advisory:

An attacker could trigger one of the vulnerabilities by causing a Qt application to parse specially crafted text or Unicode strings, which may lead to the execution of arbitrary code with the privileges of the user running the application.

Alerts:
Gentoo 200712-08 emul-linux-x86-qtlibs 2007-12-09

Comments (none posted)

firebird: arbitrary code execution

Package(s):firebird CVE #(s):CVE-2007-4992 CVE-2007-5246
Created:December 10, 2007 Updated:December 12, 2007
Description:

From the Gentoo advisory:

Adriano Lima and Ramon de Carvalho Valle reported that functions isc_attach_database() and isc_create_database() do not perform proper boundary checking when processing their input.

A remote attacker could send specially crafted requests to the Firebird server on TCP port 3050, possibly resulting in the execution of arbitrary code with the privileges of the user running Firebird (usually firebird).

Alerts:
Gentoo 200712-06 firebird 2007-12-09

Comments (none posted)

heimdal: insufficient memory allocation

Package(s):heimdal CVE #(s):CVE-2007-5939
Created:December 7, 2007 Updated:December 12, 2007
Description: The gss_userok function in appl/ftp/ftpd/gss_userok.c in Heimdal 0.7.2 does not allocate memory for the ticketfile pointer before calling free, which allows remote attackers to have an unknown impact via an invalid username. NOTE: the vulnerability was originally reported for ftpd.c, but this is incorrect.
Alerts:
Mandriva MDKSA-2007:239 heimdal 2007-12-06

Comments (1 posted)

libnfsidmap: possible privilege escalation

Package(s):libnfsidmap CVE #(s):CVE-2007-4135
Created:December 7, 2007 Updated:December 12, 2007
Description: The NFSv4 ID mapper (nfsidmap) before 0.17 does not properly handle return values from the getpwnam_r function when performing a username lookup, which can cause it to report a file as being owned by "root" instead of "nobody" if the file exists on the server but not on the client.
Alerts:
Mandriva MDKSA-2007:240 libnfsidmap 2007-12-07

Comments (none posted)

MySQL: privilege escalation

Package(s):MySQL CVE #(s):CVE-2007-3781 CVE-2007-5969
Created:December 11, 2007 Updated:May 21, 2008
Description: MySQL Community Server before 5.0.51, when a table relies on symlinks created through explicit DATA DIRECTORY and INDEX DIRECTORY options, allows remote authenticated users to overwrite system table information and gain privileges via a RENAME TABLE statement that changes the symlink to point to an existing file. (CVE-2007-5969)

MySQL Community Server before 5.0.45 does not require privileges such as SELECT for the source table in a CREATE TABLE LIKE statement, which allows remote authenticated users to obtain sensitive information such as the table structure. (CVE-2007-3781)

Alerts:
Red Hat RHSA-2008:0364-01 mysql 2008-05-21
Gentoo 200804-04 mysql 2008-04-06
SuSE SUSE-SR:2008:003 java, nss_ldap, cairo, geronimo, moodle, SDL_image, python, mysql, nx, xemacs 2008-02-07
rPath rPSA-2008-0018-1 mysql 2008-01-17
Debian DSA-1451-1 mysql-dfsg-5.0 2008-01-06
Ubuntu USN-559-1 mysql-dfsg-5.0 2007-12-21
Red Hat RHSA-2007:1157-01 mysql 2007-12-19
Fedora FEDORA-2007-4471 mysql 2007-12-15
Fedora FEDORA-2007-4465 mysql 2007-12-15
Red Hat RHSA-2007:1155-01 mysql 2007-12-18
Mandriva MDKSA-2007:243 MySQL 2007-12-10

Comments (none posted)

nagios: cross-site scripting

Package(s):nagios CVE #(s):CVE-2007-5624
Created:December 7, 2007 Updated:September 14, 2009
Description: Cross-site scripting (XSS) vulnerability in Nagios 2.x before 2.10 allows remote attackers to inject arbitrary web script or HTML via unknown vectors to unspecified CGI scripts.
Alerts:
Debian DSA-1883-2 nagios2 2009-09-14
Debian DSA-1883-1 nagios2 2009-09-10
SuSE SUSE-SR:2008:011 rsync, MozillaFirefox, poppler, nagios, lighttpd, sarg, squid, bzip2, kdelibs3, texlive-bin, kdelibs4, Sun Java 2008-05-09
Mandriva MDVSA-2008:067 nagios 2008-03-18
Fedora FEDORA-2007-4145 nagios 2007-12-06
Fedora FEDORA-2007-4123 nagios 2007-12-06

Comments (none posted)

phpMyAdmin: information disclosure

Package(s):phpMyAdmin CVE #(s):CVE-2007-0095
Created:December 11, 2007 Updated:September 25, 2008
Description: phpMyAdmin 2.9.1.1 allows remote attackers to obtain sensitive information via a direct request for themes/darkblue_orange/layout.inc.php, which reveals the path in an error message.
Alerts:
Fedora FEDORA-2008-8286 phpMyAdmin 2008-09-24
Fedora FEDORA-2008-8269 phpMyAdmin 2008-09-24
Fedora FEDORA-2008-6502 phpMyAdmin 2008-07-17
Fedora FEDORA-2008-6450 phpMyAdmin 2008-07-17
Fedora FEDORA-2008-2229 phpMyAdmin 2008-03-03
Fedora FEDORA-2008-2189 phpMyAdmin 2008-03-03
Fedora FEDORA-2007-4298 phpMyAdmin 2007-12-10
Fedora FEDORA-2007-4334 phpMyAdmin 2007-12-10

Comments (none posted)

ruby-gnome2: format string vulnerability

Package(s):ruby-gnome2 CVE #(s):CVE-2007-6183
Created:December 7, 2007 Updated:December 22, 2008
Description: A format string vulnerability in the mdiag_initialize function in gtk/src/rbgtkmessagedialog.c in Ruby-GNOME 2 (aka Ruby/Gnome2) 0.16.0, and SVN versions before 20071127, allows context-dependent attackers to execute arbitrary code via format string specifiers in the message parameter.
Alerts:
Fedora FEDORA-2008-11551 ruby-gnome2 2008-12-21
Fedora FEDORA-2008-3249 ruby-gnome2 2008-04-22
Fedora FEDORA-2008-3283 ruby-gnome2 2008-04-22
Fedora FEDORA-2008-2682 ruby-gnome2 2008-03-26
Fedora FEDORA-2008-2662 ruby-gnome2 2008-03-26
Fedora FEDORA-2008-1535 ruby-gnome2 2008-02-13
Mandriva MDVSA-2008:033 ruby-gnome2 2007-02-01
Debian DSA-1431-1 ruby-gnome2 2007-12-11
Gentoo 200712-09 ruby-gtk2 2007-12-09
Fedora FEDORA-2007-4216 ruby-gnome2 2007-12-06
Fedora FEDORA-2007-4229 ruby-gnome2 2007-12-06

Comments (none posted)

samba: stack-based buffer overflow

Package(s):samba CVE #(s):CVE-2007-6015
Created:December 11, 2007 Updated:December 3, 2008
Description: A stack buffer overflow flaw was found in the way Samba authenticates remote users. A remote unauthenticated user could trigger this flaw to cause the Samba server to crash, or execute arbitrary code with the permissions of the Samba server.
Alerts:
Fedora FEDORA-2008-10638 samba 2008-12-02
Ubuntu USN-556-1 samba 2007-12-18
SuSE SUSE-SA:2007:068 samba 2007-12-12
Mandriva MDKSA-2007:244 samba 2007-12-11
Red Hat RHSA-2007:1117-01 samba 2007-12-10
Red Hat RHSA-2007:1114-01 samba 2007-12-10
Slackware SSA:2007-344-01 samba 2007-12-11
Fedora FEDORA-2007-4275 samba 2007-12-10
Fedora FEDORA-2007-4269 samba 2007-12-10
Gentoo 200712-10 samba 2007-12-10
rPath rPSA-2007-0261-1 samba 2007-12-10
Debian DSA-1427-1 samba 2007-12-10

Comments (none posted)

xorg-x11-xfs: arbitrary code execution

Package(s):xorg-x11-xfs CVE #(s):
Created:December 10, 2007 Updated:December 12, 2007
Description:

From the xorg advisory:

Several vulnerabilities have been identified in xfs, the X font server. The QueryXBitmaps and QueryXExtents protocol requests suffer from lack of validation of their 'length' parameters. Maliciously crafted requests can either cause two different problems with both requests:

* An integer overflow in the computation of the size of a dynamic buffer can lead to a heap overflow in the build_range() function.

* An arbitrary number of bytes on the heap can be swapped by the swap_char2b() function.

Alerts:
Fedora FEDORA-2007-763 xorg-x11-xfs 2007-12-07

Comments (none posted)

zabbix: privilege escalation

Package(s):zabbix CVE #(s):CVE-2007-6210
Created:December 6, 2007 Updated:December 12, 2007
Description: Bas van Schaik has found a privilege escalation in the agentd process of the Zabbix network monitor application. Agentd can be used to run user commands under the root account, leading to an escalation of privilege.
Alerts:
Debian DSA-1420-1 zabbix 2007-12-05
Fedora FEDORA-2007-4176 zabbix 2007-12-06
Fedora FEDORA-2007-4160 zabbix 2007-12-06

Comments (none posted)

Page editor: Jake Edge
Next page: Kernel development>>


Copyright © 2007, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds