what you don't know can hurt you
Home Files News &[SERVICES_TAB]About Contact Add New

OpenSSH Security Advisory - Unauthorized Access

OpenSSH Security Advisory - Unauthorized Access
Posted May 4, 2011
Authored by Damien Miller | Site openssh.com

OpenSSH Security Advisory - Portable OpenSSH prior to version 5.8p2 only on platforms that are configured to use ssh-rand-helper for entropy collection. ssh-rand-helper is enabled at configure time when it is detected that OpenSSL does not have a built-in source of randomness, and only used at runtime if this condition remains. Platforms that support /dev/random or otherwise configure OpenSSL with a random number provider are not vulnerable. Version 5.8p2 fixes this issue.

tags | advisory
SHA-256 | 486207ec2f9fb1f7152210c018051c0a98ac5a4908b2ab16da056d78f48c5319

OpenSSH Security Advisory - Unauthorized Access

Change Mirror Download
OpenSSH Security Advisory: portable-keysign-rand-helper.adv

This document may be found at:
http://www.openssh.com/txt/portable-keysign-rand-helper.adv

1. Vulnerability

Portable OpenSSH's ssh-keysign utility may allow unauthorised
local access to host keys on platforms if ssh-rand-helper is
used.

2. Affected configurations

Portable OpenSSH prior to version 5.8p2 only on platforms
that are configured to use ssh-rand-helper for entropy
collection.

ssh-rand-helper is enabled at configure time when it is
detected that OpenSSL does not have a built-in source of
randomness, and only used at runtime if this condition
remains. Platforms that support /dev/random or otherwise
configure OpenSSL with a random number provider are not
vulnerable.

In particular, *BSD, OS X, Cygwin and Linux are not
affected.

3. Mitigation

If host-based authentication is not in use (enabled using
HostBasedAuthentication or RhostsRSAAuthentication in
sshd_config), then remove the setuid bit from ssh-keysign.

4. Details

ssh-keysign is a setuid helper program that is used to mediate
access to the host's private host keys during host-based
authentication. It would use its elevated privilege to open
the keys and then immediately drop privileges to complete its
cryptographic signing operations.

After privilege was dropped, ssh-keysign would ensure that
the OpenSSL random number generator that it depends upon was
adequately prepared. On configurations that lacked a built-in
source of entropy in OpenSSL, ssh-keysign would execute the
ssh-rand-helper program to attempt to retrieve some from the
system environment.

However, the file descriptors to the host private key files
were not closed prior to executing ssh-rand-helper. Since this
process was "born unprivileged" and inherited the sensitive
file descriptors, there was no protection against an attacker
using ptrace(2) to attach to it and instructing it to read out
the private keys.

5. Credit

This issue was privately reported by Tomas Mraz on April 26,
2011.

6. Fix

OpenSSH 5.8p2 contains a fix for this vulnerability.

Future releases of portable OpenSSH will remove support for
ssh-rand-helper - in 2011, there is no excuse for not
providing a /dev/random-like interface as part of the OS.
Users stuck on one of these platforms may use PRNGd
(http://prngd.sf.net) to provide a host-wide random pool.

Users of older versions that do not wish to upgrade
immediately may apply this patch:

Index: ssh-keysign.c
===================================================================
RCS file: /var/cvs/openssh/ssh-keysign.c,v
retrieving revision 1.43
diff -u -p -r1.43 ssh-keysign.c
--- ssh-keysign.c 10 Sep 2010 01:12:09 -0000 1.43
+++ ssh-keysign.c 29 Apr 2011 01:25:55 -0000
@@ -167,6 +167,9 @@ main(int argc, char **argv)

key_fd[0] = open(_PATH_HOST_RSA_KEY_FILE, O_RDONLY);
key_fd[1] = open(_PATH_HOST_DSA_KEY_FILE, O_RDONLY);
+ if (fcntl(key_fd[0], F_SETFD, FD_CLOEXEC) != 0 ||
+ fcntl(key_fd[1], F_SETFD, FD_CLOEXEC) != 0)
+ fatal("fcntl failed");

original_real_uid = getuid(); /* XXX readconf.c needs this */
if ((pw = getpwuid(original_real_uid)) == NULL)
Login or Register to add favorites

File Archive:

April 2024

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    Apr 1st
    10 Files
  • 2
    Apr 2nd
    26 Files
  • 3
    Apr 3rd
    40 Files
  • 4
    Apr 4th
    6 Files
  • 5
    Apr 5th
    26 Files
  • 6
    Apr 6th
    0 Files
  • 7
    Apr 7th
    0 Files
  • 8
    Apr 8th
    22 Files
  • 9
    Apr 9th
    14 Files
  • 10
    Apr 10th
    10 Files
  • 11
    Apr 11th
    13 Files
  • 12
    Apr 12th
    14 Files
  • 13
    Apr 13th
    0 Files
  • 14
    Apr 14th
    0 Files
  • 15
    Apr 15th
    30 Files
  • 16
    Apr 16th
    10 Files
  • 17
    Apr 17th
    22 Files
  • 18
    Apr 18th
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 Files
  • 26
    Apr 26th
    0 Files
  • 27
    Apr 27th
    0 Files
  • 28
    Apr 28th
    0 Files
  • 29
    Apr 29th
    0 Files
  • 30
    Apr 30th
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2022 Packet Storm. All rights reserved.

Services
Security Services
Hosting By
Rokasec
close