[18158] in bugtraq
Stunnel format bug
daemon@ATHENA.MIT.EDU (Lez)
Mon Dec 18 23:57:29 2000
Mime-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Message-Id: <Pine.LNX.3.96.1001218154211.2583A-100000@lez>
Date: Mon, 18 Dec 2000 16:58:29 +0100
Reply-To: Lez <lez@SCH.BME.HU>
From: Lez <lez@SCH.BME.HU>
To: BUGTRAQ@SECURITYFOCUS.COM
<Macaroon Advisory>
Hi, ppl
We have recently discovered a format bug in stunnel<= 3.8 in which the
log() function calls directly the syslog() with only two parameters:
syslog(level, text). It should be syslog(level, "%s", text).
If a user can pass any string that is written to the log file, he can
exploit this vulnerablilty with carefully formatted formatstrings (with %n
in it).
When debugging is turned on (-d 7) the username that is looked up via
ident is written to the log file. So if the client can manipulate it's
ident username, he can own the host running stunnel. Another case, when
stunnel's native smtp support and debugging is turned on, it's
exploitable, too. Of course it's not a complete list of exploit methods.
There may be many more.
The fix from the stunnel author (Michal Trojnara) is out, you can download
the latest stable version from
http://www.stunnel.org/download/stunnel/src/stunnel-3.9.tar.gz
or you can hotfix the bug in log.c (about line 67):
- syslog(level, text);
+ syslog(level, "%s", text);
Marry Christmas :)
</Macaroon Advisory>
--
Lez
lez@sch.hu