diff -ruBbd cacti-0.8.6h/cmd.php cacti-0.8.6h-patch/cmd.php --- cacti-0.8.6h/cmd.php 2006-01-03 22:08:30.000000000 -0500 +++ cacti-0.8.6h-patch/cmd.php 2007-01-01 12:31:15.203125000 -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."); } @@ -71,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.6h/copy_cacti_user.php cacti-0.8.6h-patch/copy_cacti_user.php --- cacti-0.8.6h/copy_cacti_user.php 2006-01-03 22:08:30.000000000 -0500 +++ cacti-0.8.6h-patch/copy_cacti_user.php 2007-01-01 12:31:15.203125000 -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