evolve or die

FreeBSD Security Advisory 2002.41

FreeBSD Security Advisory 2002.41
Posted Nov 17, 2002
Authored by The FreeBSD Project | Site freebsd.org

FreeBSD Security Advisory FreeBSD-SA-02:41 - The sendmail Restricted Shell command (smrsh) contains errors in the handling of command arguments with "||" or spaces which allow the execution of commands outside of those in its target directory. Since command arguments may be specified in local users' .forward' files, the smrsh restrictions may be bypassed using such files that are specially crafted.

tags | shell, local
systems | freebsd
MD5 | 56bc24cb1514d9e5c1f70e9ad3458284

FreeBSD Security Advisory 2002.41

Change Mirror Download
-----BEGIN PGP SIGNED MESSAGE-----

=============================================================================
FreeBSD-SA-02:41.smrsh Security Advisory
The FreeBSD Project

Topic: smrsh restrictions can be bypassed [REVISED]

Category: core
Module: contrib_sendmail
Announced: 2002-11-15
Credits: zen-parse <zen-parse@gmx.net>,
Pedram Amini <pamini@idefense.com>,
iDEFENSE <URL:http://www.idefense.com/>
Affects: All releases prior to FreeBSD 4.7-RELEASE
Corrected: 2002-10-08 00:53:31 UTC (RELENG_4)
2002-10-08 00:57:20 UTC (RELENG_4_7)
2002-10-26 21:11:30 UTC (RELENG_4_6)
2002-10-26 21:10:59 UTC (RELENG_4_5)
2002-10-26 21:10:22 UTC (RELENG_4_4)
2002-10-26 21:08:42 UTC (RELENG_4_3)
FreeBSD only: NO

0. Revision History

v1.0 2002-11-12 Initial release.
v1.1 2002-11-15 Correct patch instructions. Update workaround.
Add CVE reference.

I. Background

The sendmail Restricted Shell command (smrsh) is intended as a
replacement for the system shell (/bin/sh) for use by sendmail. It
limits the set of programs that can be executed through sendmail to
those in a single directory, and limits shell built-in commands.

II. Problem Description

Errors in smrsh's handling of command arguments with "||" or spaces
may allow the execution of commands outside of those in its target
directory. Since command arguments may be specified in local users'
`.forward' files, the smrsh restrictions may be bypassed using such
files that are specially crafted.

III. Impact

Users with a local account and the ability to create or modify their
`.forward' files can circumvent the smrsh restrictions. This is
mostly of consequence to systems which have local users that are not
normally allowed access to a login shell, as such users may abuse this
bug in order to execute arbitrary commands with normal privileges.

IV. Workaround

[The workaround described in revision 1.0 of this advisory was
effective, but disabled more functionality than was necessary.]

Disable sendmail delivery to programs. To do so, add the following line
to the sendmail.mc file, regenerate the sendmail.cf configuration file,
and restart sendmail.

MODIFY_MAILER_FLAGS(`LOCAL', `-|')

V. Solution

1) Upgrade your vulnerable system to 4.7-STABLE; or to the RELENG_4_7,
RELENG_4_6, RELENG_4_5, RELENG_4_4, or RELENG_4_3 security branch
dated after the correction date.

2) To patch your present system:

The following patch has been verified to apply to FreeBSD 4.4, FreeBSD
4.5, and FreeBSD 4.6 systems.

a) Download the relevant patch from the location below, and verify the
detached PGP signature using your PGP utility.

# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:41/smrsh.patch
# fetch ftp://ftp.FreeBSD.org/pub/FreeBSD/CERT/patches/SA-02:41/smrsh.patch.asc

b) Execute the following commands as root:

# cd /usr/src
# patch < /path/to/patch
# cd /usr/src/lib/libsm
# make depend && make
# cd /usr/src/lib/libsmutil
# make depend && make
# cd /usr/src/usr.sbin/sendmail
# make depend && make && make install

VI. Correction details

The following list contains the revision numbers of each file that was
corrected in FreeBSD.

Path Revision
Branch
- -------------------------------------------------------------------------
src/contrib/sendmail/smrsh/smrsh.c
RELENG_4 1.3.6.9
RELENG_4_7 1.3.6.8.2.1
RELENG_4_6 1.3.6.6.2.1
RELENG_4_5 1.3.6.5.4.1
RELENG_4_4 1.3.6.5.2.1
RELENG_4_3 1.3.6.4.2.1
- -------------------------------------------------------------------------

VII. References

<URL:http://www.idefense.com/advisory/10.01.02.txt>
<URL:http://cve.mitre.org/cgi-bin/cvename.cgi?name=CAN-2002-1165>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (FreeBSD)

iQCVAwUBPdT6BlUuHi5z0oilAQH1wgP/c0q4JSntzNaWoHdCFv9IeA7R08bQCUUH
DnDQIlqdQca0cJJ7mNOjK0gwAasRaCuIDjbjA1DUbfx6THoBkO4ZxzgXPMzOAC7N
89ziBYeKzaB2IA3e3phWklIl9qbZ46kEcKfpRlX/S34Bkr+sbv4FXKxEIYg6W+tO
xOjBWvbZ/5I=
=cuqM
-----END PGP SIGNATURE-----

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-security-notifications" in the body of the message

Comments

RSS Feed Subscribe to this comment feed

No comments yet, be the first!

Login or Register to post a comment

File Archive:

May 2012

  • Su
  • Mo
  • Tu
  • We
  • Th
  • Fr
  • Sa
  • 1
    May 1st
    37 Files
  • 2
    May 2nd
    53 Files
  • 3
    May 3rd
    33 Files
  • 4
    May 4th
    4 Files
  • 5
    May 5th
    10 Files
  • 6
    May 6th
    17 Files
  • 7
    May 7th
    19 Files
  • 8
    May 8th
    36 Files
  • 9
    May 9th
    34 Files
  • 10
    May 10th
    35 Files
  • 11
    May 11th
    20 Files
  • 12
    May 12th
    18 Files
  • 13
    May 13th
    11 Files
  • 14
    May 14th
    27 Files
  • 15
    May 15th
    58 Files
  • 16
    May 16th
    54 Files
  • 17
    May 17th
    25 Files
  • 18
    May 18th
    53 Files
  • 19
    May 19th
    9 Files
  • 20
    May 20th
    15 Files
  • 21
    May 21st
    25 Files
  • 22
    May 22nd
    32 Files
  • 23
    May 23rd
    35 Files
  • 24
    May 24th
    26 Files
  • 25
    May 25th
    25 Files
  • 26
    May 26th
    0 Files
  • 27
    May 27th
    0 Files
  • 28
    May 28th
    0 Files
  • 29
    May 29th
    0 Files
  • 30
    May 30th
    0 Files
  • 31
    May 31st
    0 Files

Top Authors In Last 30 Days

File Tags

Systems

packet storm

© 2012 Packet Storm. All rights reserved.

close