diff -ruBbd cacti-0.8.6i/cmd.php cacti-0.8.6i-patch/cmd.php --- cacti-0.8.6i/cmd.php 2006-10-09 00:06:00.000000000 -0400 +++ cacti-0.8.6i-patch/cmd.php 2007-01-01 12:27:15.328125000 -0500 @@ -26,7 +26,7 @@ */ /* do NOT run this script through a web browser */ -if (!isset($_SERVER["argv"][0])) { +if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) { die("
This script is only meant to run at the command line."); } @@ -70,6 +71,10 @@ $print_data_to_stdout = false; if ($_SERVER["argc"] == "3") { if ($_SERVER["argv"][1] <= $_SERVER["argv"][2]) { + /* address potential exploits */ + input_validate_input_number($_SERVER["argv"][1]); + input_validate_input_number($_SERVER["argv"][2]); + $hosts = db_fetch_assoc("select * from host where (disabled = '' and " . "id >= " . $_SERVER["argv"][1] . diff -ruBbd cacti-0.8.6i/copy_cacti_user.php cacti-0.8.6i-patch/copy_cacti_user.php --- cacti-0.8.6i/copy_cacti_user.php 2006-10-09 00:06:00.000000000 -0400 +++ cacti-0.8.6i-patch/copy_cacti_user.php 2007-01-01 12:27:15.312500000 -0500 @@ -25,9 +25,10 @@ */ /* do NOT run this script through a web browser */ -if (! isset($_SERVER["argv"][0])) { - die("This script is only meant to run at the command line.\n"); +if (!isset($_SERVER["argv"][0]) || isset($_SERVER['REQUEST_METHOD']) || isset($_SERVER['REMOTE_ADDR'])) { + die("
This script is only meant to run at the command line."); } + if (empty($_SERVER["argv"][2])) { die("\nSyntax:\n php copy_cacti_user.php