[Nagiosplug-devel] [ nagiosplug-Bugs-3465557 ] 'check_ups' - Buffer Overflow

SourceForge.net noreply at sourceforge.net
Mon Dec 26 11:08:39 CET 2011


Bugs item #3465557, was opened at 2011-12-26 02:08
Message generated for change (Tracker Item Submitted) made by sschurtz
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3465557&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Argument proccessing
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: sschurtz (sschurtz)
Assigned to: Nobody/Anonymous (nobody)
Summary: 'check_ups' - Buffer Overflow

Initial Comment:
Hi, 

there is a buffer overflow in the check_ups plugin

./check_ups -u `perl -e 'print "A"x16407'`
*** buffer overflow detected ***: ./check_ups terminated
======= Backtrace: =========
/lib/libc.so.6(__fortify_fail+0x50)[0x25d970]
/lib/libc.so.6(+0xe486a)[0x25c86a]
/lib/libc.so.6(+0xe3fa8)[0x25bfa8]
/lib/libc.so.6(_IO_default_xsputn+0x9e)[0x1e2a2e]
/lib/libc.so.6(_IO_vfprintf+0x36b2)[0x1b88c2]
/lib/libc.so.6(__vsprintf_chk+0xad)[0x25c05d]
/lib/libc.so.6(__sprintf_chk+0x2d)[0x25bf9d]
./check_ups[0x8049e66]
./check_ups[0x804a105]
./check_ups[0x804a4ce]
/lib/libc.so.6(__libc_start_main+0xe7)[0x18ece7]
./check_ups[0x80491a1]
======= Memory map: ========
00110000-0012c000 r-xp 00000000 08:01 660177     /lib/ld-2.12.1.so
0012c000-0012d000 r--p 0001b000 08:01 660177     /lib/ld-2.12.1.so
0012d000-0012e000 rw-p 0001c000 08:01 660177     /lib/ld-2.12.1.so
0012e000-0012f000 r-xp 00000000 00:00 0          [vdso]
0012f000-00142000 r-xp 00000000 08:01 660186     /lib/libnsl-2.12.1.so
00142000-00143000 r--p 00012000 08:01 660186     /lib/libnsl-2.12.1.so
00143000-00144000 rw-p 00013000 08:01 660186     /lib/libnsl-2.12.1.so

// without stack protection

sysctl -w kernel.randomize_va_space=0

gcc -fno-stack-protector -z execstack -DNP_VERSION=\"1.4.15\" -g -o check_ups check_ups.c netutils.o utils.o -L/usr/src/nagios-plugins-1.4.15/plugins ../lib/libnagiosplug.a ../gl/libgnu.a -DLOCALEDIR=\"/usr/local/nagios/share/locale\" -I../lib -I../gl -I../intl -I..

./check_ups -u `perl -e 'print "A"x16408'`
Connection refused
Invalid response received from host
Segmentation fault

(gdb) run -u `perl -e 'print "A"x16408'`
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program: /usr/src/nagios-plugins-1.4.15/plugins/check_ups -u `perl -e 'print "A"x16408'`
Connection refused
Invalid response received from host

Program received signal SIGSEGV, Segmentation fault.
0x41414141 in ?? ()
(gdb) i r
eax            0xffffffff       -1
ecx            0x2914e0 2692320
edx            0x292360 2696032
ebx            0x41414141       1094795585
esp            0xbfff56f0       0xbfff56f0
ebp            0x41414141       0x41414141 <--- AAAA
esi            0x0      0
edi            0x0      0
eip            0x41414141       0x41414141 <--- AAAA
eflags         0x10286  [ PF SF IF RF ]
cs             0x73     115
ss             0x7b     123
ds             0x7b     123
es             0x7b     123
fs             0x0      0
gs             0x33     51

By default the plugin has no suid or guid bit set, so there should be no security risk.

Best regards,
sschurtz

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=3465557&group_id=29880




More information about the Devel mailing list