Application: Cacti Vendor URL: http://www.cacti.net Bugs: SQL injection Author:changzhao.mao(DBAPPSecurity Ltd) Version affected: 0.8.8f and prior ================================ Introduction ================================ Cacti is a complete frontend to RRDTool, it stores all of the necessary information to create graphs and populate them with data in a MySQL database. The frontend is completely PHP driven. Along with being able to maintain Graphs, Data Sources, and Round Robin Archives in a database, cacti handles the data gathering. There is also SNMP support for those used to creating traffic graphs with MRTG. SQL injection vulnerabilities has been discovered.The vulnerability allows any users to execute own sql commands to compromise the web-applicaation or database management system.The vulnerabilities are located in the rra_id value of the graph.php file.This php file of older version cacti may be accessible anonymously according to the cases I found from the internet. Latest version cacti may require guest user privilege. [Vulnerability info] /cacti-0.8.8f/graph.php line 25 include "./include/top_graph_header.php" before validating rra_id /* set default action */ if (!isset($_REQUEST["action"])) { $_REQUEST["action"] = "view"; } if (!isset($_REQUEST["view_type"])) { $_REQUEST["view_type"] = ""; } $guest_account = true; include("./include/auth.php"); include_once("./lib/rrd.php"); api_plugin_hook_function('graph'); include_once("./lib/html_tree.php"); include_once("./include/top_graph_header.php"); /* ================= input validation ================= */ input_validate_input_regex(get_request_var("rra_id"), "^([0-9]+|all)$"); input_validate_input_number(get_request_var("local_graph_id")); input_validate_input_number(get_request_var("graph_end")); input_validate_input_number(get_request_var("graph_start")); input_validate_input_regex(get_request_var_request("view_type"), "^([a-zA-Z0-9]+)$"); /* ==================================================== */ /cacti-0.8.8f/include/top_graph_header.php line 30 rra_id is not validated /* ================= input validation ================= */ input_validate_input_number(get_request_var_request("local_graph_id")); input_validate_input_number(get_request_var_request("graph_start")); input_validate_input_number(get_request_var_request("graph_end")); /* ==================================================== */ line 158