CVE-2009-2904: Medium severity openssh vulnerability

Published Sep 9, 2009
·
Updated

A certain Red Hat modification to the ChrootDirectory feature in OpenSSH 4.8, as used in sshd in OpenSSH 4.3 in Red Hat Enterprise Linux (RHEL) 5.4 and Fedora 11, allows local users to gain privileges via hard links to setuid programs that use configuration files within the chroot directory, related to requirements for directory ownership.

Other sources

OpenSSH version 4.8 introduced support for ChrootDirectory configuration option, which allows chrooting of users after successful authentication to a specified directory:

http://openssh.org/txt/release-4.8

sshd requires strict permissions of the chroot directory and all parent directories, as detailed in the manual pages:

sshdconfig(5)

This path, and all its components, must be root-owned directories that are not writable by any other user or group.

http://www.openbsd.org/cgi-bin/man.cgi?query=sshdconfig&sektion=5

OpenSSH version in Red Hat Enterprise Linux 5 (backport of ChrootDirectory was added in 5.4) and Fedora 11 (only testing, at the moment) relaxed this check to allow directories to be owned by the user logging in, to make ChrootDirectory %h setting work more "as expected". However, it was discovered that this change makes system more vulnerable to attacks using mis-configured chroot directory trees.

Possible attack requires user to be able to create hard links to setuid programs installed on the system out of the chroot. This actually consists of two requirements:

- user must have non-chroot-ed shell access to the system (e.g. local console access, or do the setup of the chroot directory before ChrootDirectory is enabled for the user)

- target setuid program must be located on the same file system as user's home directory

If the behaviour of the target setuid program is controlled by some configuration file (e.g. PAM configuration files, library), it may use attacker-controlled file instead of the administrator-controlled one and allow user to escalate privileges, when program is executed inside of the chroot.

Other attack vectors may be possible.

Upstream bugreport proposing upstream inclusion of the fix: https://bugzilla.mindrot.org/showbug.cgi?id=1593 (with upstream stating this is a bad idea)

Article describing the use of ChrootDirectory: http://undeadly.org/cgi?action=article&sid=20080220110039

Red Hat

Affected Software

6 affected components
OpenBSD OpenSSH=4.3
OpenBSD OpenSSH=4.8
Fedoraproject Fedora=11
redhat Enterprise Linux=5
redhat Enterprise Linux Desktop=5
redhat Enterprise Linux Eus=5

Event History

Sep 9, 2009
Data Sourced
via Red Hat·03:11 PM
DescriptionSeverityAffected Software
Oct 1, 2009
CVE Published
via MITRE·03:00 PM
Data Sourced
via MITRE·03:00 PM
Description
Data Sourced
03:30 PM
DescriptionWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2009-2904?

CVE-2009-2904 has a medium severity rating, as it allows local users to escalate privileges.

2

How do I fix CVE-2009-2904?

To fix CVE-2009-2904, update OpenSSH to a version that does not include the vulnerable ChrootDirectory modification.

3

Who is affected by CVE-2009-2904?

CVE-2009-2904 affects local users of Red Hat Enterprise Linux 5.4 and OpenSSH versions 4.3 and 4.8.

4

What is the impact of exploiting CVE-2009-2904?

Exploitation of CVE-2009-2904 could allow an attacker to gain elevated privileges on the affected system.

5

What software versions are vulnerable to CVE-2009-2904?

The vulnerable software versions for CVE-2009-2904 are OpenSSH 4.3 and OpenSSH 4.8 as modified by Red Hat.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203