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

sa97-02

sa97-02
Posted Sep 23, 1999

Buffer overflow in lpd

tags | overflow
systems | freebsd
SHA-256 | 3d249a9c1c7856e98ad3ef5f4f46165501870ac43c048e7f2f56448cbea07357

sa97-02

Change Mirror Download

From aleph1@DFW.NET Thu Mar 27 18:45:08 1997
Date: Wed, 26 Mar 1997 16:59:12 -0600
From: Aleph One <aleph1@DFW.NET>
To: BUGTRAQ@NETSPACE.ORG
Subject: FreeBSD-SA-97:02: Buffer overflow in lpd

-----BEGIN PGP SIGNED MESSAGE-----

=============================================================================
FreeBSD-SA-97:02 Security Advisory
FreeBSD, Inc.

Topic: Buffer overflow in lpd

Category: core
Module: lpd
Announced: 1997-03-xxx
Affects: FreeBSD 2.1.7 and earlier and FreeBSD 2.2 snapshots
before 1997/02/25 suffer from this problem.
Corrected: FreeBSD-current as of 1997/02/25
FreeBSD 2.2 as of 1997/02/25
FreeBSD only: yes

Patches: ftp://freebsd.org/pub/CERT/patches/SA-97:02/

=============================================================================

I. Background

The lpd program is used to print local and remote print jobs. It
is standard software in the FreeBSD operating system.

II. Problem Description

The lpd program runs as root. A remote attacker can exploit a
buffer overflow to obtain root privs.

III. Impact

Remote users can gain root privs.

IV. Workaround

The only workaround is to disable lpd, which will have the effect
of removing the printing functionality from the system. Since
the buffer overflow happens before the connection is authenticated,
using lpd's authentication methods will not affect the system
vulnerability.

V. Solution

Apply the following patch, rebuild and install libc:

(This patch can also be found on
ftp://freebsd.org/pub/CERT/patches/SA-97:02/)

Index: rcmd.c
===================================================================
RCS file: /home/imp/FreeBSD/CVS/src/lib/libc/net/rcmd.c,v
retrieving revision 1.3.4.4
retrieving revision 1.3.4.5
diff -u -r1.3.4.4 -r1.3.4.5
--- rcmd.c 1997/02/09 06:57:54 1.3.4.4
+++ rcmd.c 1997/02/26 06:14:11 1.3.4.5
@@ -377,7 +377,8 @@
if ((hp = gethostbyaddr((char *)&raddr, sizeof(u_long),
AF_INET)) == NULL)
return (-1);
- strcpy(hname, hp->h_name);
+ strncpy(hname, hp->h_name, sizeof(hname));
+ hname[sizeof(hname) - 1] = '\0';

while (fgets(buf, sizeof(buf), hostf)) {
p = buf;

VI. Thanks

This problem was brought to light by Oliver Friedrichs
<oliver@SECNET.COM>.

=============================================================================
FreeBSD, Inc.

Web Site: http://www.freebsd.org/
Confidential contacts: security-officer@freebsd.org
PGP Key: ftp://freebsd.org/pub/CERT/public_key.asc
Security notifications: security-notifications@freebsd.org
Security public discussion: security@freebsd.org

Notice: Any patches in this document may not apply cleanly due to
modifications caused by digital signature or mailer software.
Please reference the URL listed at the top of this document
for original copies of all patches if necessary.
=============================================================================

-----BEGIN PGP SIGNATURE-----
Version: 2.6.2

iQCVAwUBMzmOqlUuHi5z0oilAQH1hAP/fSVklicjFNo4hLVO2dYLLiIPnB9uVWNl
ocC2Ozu1sX6SH3Kz688QlTEnyDzjshkisI9nr+947A/CjwJDPwqQRbqmbAdI+qka
HNQJmVQYWW2J6j70SJX8q0z1uQHoNsJB7VStQ1VX+4BD91CsjBr3lrU5xFyjqxYt
uJMeNl0sa9A=
=agxY
-----END PGP SIGNATURE-----
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
    8 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    11 Files
  • 23
    Apr 23rd
    68 Files
  • 24
    Apr 24th
    23 Files
  • 25
    Apr 25th
    16 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