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

pam-krb5 File Ovewrite

pam-krb5 File Ovewrite
Posted Feb 11, 2009
Authored by Russ Allbery

A security vulnerability in pam-krb5 allowing overwrite and chown of arbitrary files via Solaris su was discovered by Derek Chan and reported by Steven Luo on 2009-01-29. Subsequent code auditing for behavior in setuid applications uncovered another, more general and more serious bug that could result in privilege escalation. Versions below 3.13 are affected.

tags | advisory, arbitrary
systems | solaris
advisories | CVE-2009-0360, CVE-2009-0361
SHA-256 | bdb406a56845ea6531e01e4f9824194fe901c4587b9a6192655d9830a038ffb2

pam-krb5 File Ovewrite

Change Mirror Download
                     pam-krb5 security vulnerability

Vulerability type: Local privilege escalation, local file overwrite
Versions affected: All versions prior to 3.13
Versions fixed: 3.13 and later
Reported: 2009-01-29
Public announcement: 2009-02-11
CVE IDs: CVE-2009-0360, CVE-2009-0361

A security vulnerability in pam-krb5 allowing overwrite and chown of
arbitrary files via Solaris su was discovered by Derek Chan and reported
by Steven Luo on 2009-01-29. Subsequent code auditing for behavior in
setuid applications uncovered another, more general and more serious bug
that could result in privilege escalation.

This advisory is only for my pam-krb5 module, as distributed from my web
site and packaged by Debian, Ubuntu, and Gentoo. These vulnerabilities
will likely also affect any PAM modules derived from mine, but I'm not
personally aware of any such modules in widespread use. The Red Hat,
Sourceforge, and Solaris pam_krb5 and pam_krb5afs modules have completely
different lineages and code and would need to be checked separately for
the presence or absence of these problems. I urge all Kerberos PAM module
developers to check their modules for similar problems.

The following two vulnerbilities are present in all versions of my
pam-krb5 module prior to 3.13:

CVE-2009-0360

When linked with MIT Kerberos, pam-krb5 did not use the correct API
for initializing the Kerberos libraries in a setuid context. This
meant the MIT Kerberos libraries would trust environmental variables
to locate the Kerberos configuration. An attacker could exploit this
to bypass authentication checks in setuid applications using PAM for
authentication, resulting in privilege escalation. This vulnerability
was not present if pam-krb5 was linked with the Heimdal Kerberos
implementation.

CVE-2009-0361

pam_setcred with PAM_REINITIALIZE_CREDS or PAM_REFRESH_CREDS is used
to refresh existing credentials for a user, such as when releasing a
locked screen. It therefore honors the existing KRB5CCNAME
environment variable to locate the existing Kerberos credential cache.
This means, however, that if those APIs were called by a setuid
application without first calling PAM_ESTABLISH_CREDS or dropping
privileges, pam-krb5 may overwrite and chown the file specified by
KRB5CCNAME to an attacker. This PAM calling sequence is unusual, but
it's known to be used by Solaris 10 su. pam-krb5 3.13 and later will
log an error message and return success without taking any action when
a program attempts to reinitialize credentials in a setuid context.

I'm not aware of any exploits in the wild for either problem, but I have
working exploits for both. An exploit of the first vulnerability is
straightforward for anyone with knowledge of Kerberos. An exploit for the
second vulnerability requires identifying an application that uses the
vulnerable PAM calling sequence but is completely trivial once such an
application has been identified.

These problems have been corrected in pam-krb5 3.13, available from:

http://www.eyrie.org/~eagle/software/pam-krb5/

Direct download links to the release and the PGP signature of the release:

http://archives.eyrie.org/software/kerberos/pam-krb5-3.13.tar.gz
http://archives.eyrie.org/software/kerberos/pam-krb5-3.13.tar.gz.asc

pam-krb5 was released as the libpam-krb5 package with Debian 4.0 (etch).
These vulnerabilities have been fixed in the 2.6-1etch1 version of the
libpam-krb5 Debian package for Debian 4.0. They have also been fixed in
the 3.11-4 package for the upcoming Debian 5.0 (lenny) release and for
Debian unstable (sid).

pam-krb5 linked with the Heimdal Kerberos implementation was also released
as the libpam-heimdal package with Debian 4.0 (etch). This package is not
vulnerable to the first problem (CVE-2009-0360). The second problem
(CVE-2009-0361) has been fixed in the 2.5-1etch1 version of the
libpam-heimdal Debian package for Debian 4.0 and in the 3.10-2.1 version
for the upcoming Debian 5.0 (lenny) release and Debian unstable (sid).

Please accept my personal apologies for these vulnerabilities. The first
vulnerability in particular was an error I should have known about and
fixed some time previous. I even followed a BUGTRAQ discussion of a
closely related problem with Kerberos authentication in sudo, did some
investigation at the time, and apparently forgot or misremembered the
results of my investigation.

--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
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
    45 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