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

Nagios Core 3.4.3 Buffer Overflow

Nagios Core 3.4.3 Buffer Overflow
Posted Dec 10, 2012
Authored by temp66

Nagios Core version 3.4.3 suffers from a stack-based buffer overflow vulnerability in the history.cgi web interface.

tags | advisory, web, overflow, cgi
SHA-256 | 88ac488f066319dd1f959b62a5b728615dc7728fccc1e533414c99c5543167e4

Nagios Core 3.4.3 Buffer Overflow

Change Mirror Download
history.cgi is vulnerable to a buffer overflow due to the use of
sprintf with user supplied data that has not been restricted in size.
This vulnerability does not appear to be exploitable on the majority
of systems (due to stack cookies, the NX bit, etc).

In the process_cgivars function:
/* do some basic length checking on the variable
identifier to prevent buffer overflows */
if(strlen(variables[x]) >= MAX_INPUT_BUFFER - 1)
continue;

The above code is only applied to the parameter names, not their
values which allows the host_name and svc_description variables to be
of any length.

Later, in the get_history function:
if(history_type == HOST_HISTORY ||
history_type == SERVICE_HISTORY) {
sprintf(match1, " HOST ALERT:
%s;", host_name);
sprintf(match2, " SERVICE
ALERT: %s;", host_name);
}

match1 and match2 are each MAX_INPUT_BUFFER (1024) bytes long. Similar
lines appear later in the same function. These should be changed to
snprintf calls (even host_name were restricted in size, these calls
could still result in an overflow).

The above code is only run under certain circumstances, eg when there
is a "SERVICE ALERT" line (for any host) in the log that is being
processed.

An example url that results in an overflow (and segfault):
http://nagiosserver/nagios/cgi-bin/history.cgi?host=aaaaaaa... (4000 'a's)

When the cgi is run from the command line (with setting environment
variables for the parameters), gdb shows:
Program received signal SIGSEGV, Segmentation fault.
0x61616161 in ?? ()

The above was tested on Slackware 14.0 i386.


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
    0 Files
  • 19
    Apr 19th
    0 Files
  • 20
    Apr 20th
    0 Files
  • 21
    Apr 21st
    0 Files
  • 22
    Apr 22nd
    0 Files
  • 23
    Apr 23rd
    0 Files
  • 24
    Apr 24th
    0 Files
  • 25
    Apr 25th
    0 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