Home page logo

bugtraq logo Bugtraq mailing list archives

Re: Format strings: bug #1: BSD-lpr
From: Sean Winn <sean () GOTHIC NET AU>
Date: Tue, 26 Sep 2000 16:51:02 +1100


        if ((s = checkremote()) != NULL)
                syslog(LOG_WARNING, s);


        if ((s = checkremote(pp)) != 0) {
                syslog(LOG_WARNING, "%s", s);

Looking back, it appears to be fixed in this commit

Revision 1.18 / (download) - annotate - [select for diffs] , Tue Dec 2
20:45:58 1997 UTC (2 years, 9 months ago) by wollman
Branch: MAIN
Changes since 1.17: +321 -345 lines
Diff to previous 1.17
Mega lpd/lpd upgrade, part I:

- Get rid of a lot of the static variables which were shared by
  many routines and programs in the suite.
- Create an abstract interface to the printcap database, so that
  other retrieval and iteration mechanisms could be developed
  (e.g., YP, Hesiod, or automatic retrieval from a trusted server).
- Give each capability a human-readable name in addition to the historic
  two-character one.
- Otherwise generally clean up a lot of dark corners.  Many still remain.
- When submitting jobs, use the official login name record (from getlogin())
  if there is one, rather than reverse-mapping the uid.

More to come...

----- Original Message -----
From: "Chris Evans" <chris () SCARY BEASTS ORG>
Sent: Tuesday, September 26, 2000 10:57 AM
Subject: Format strings: bug #1: BSD-lpr



Welcome to a short series of security bugs, all involving mistakes with
"user supplied format strings". This class of bug is very popular on
Bugtraq at the moment, so what an ideal time for a few examples.


If we look into

lpr/lpd/printjob.c, we can find the following two lines of code

        if ((s = checkremote()))
                syslog(LOG_WARNING, s);

This is a classic format string mistake.

It may not be exploitable, because the failure strings returned by
checkremote() in lpr/common_source/common.c, do not contain much data that
a user could control.

However, it illustrates that format string bugs creep in everywhere, even
in code that gets syslog() calls correct the majority of the time, as is
the case with BSD-lpr.


OpenBSD ship BSD-lpr. Not only have they already fixed this in their CVS,
but they also offer web indexed CVS. They caught it independently as part
of their "format strings" audit.



The next format string bug in the series will be much more interesting.


  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]