Cacti 0.8.6e and earlier does not perform proper input validation to protect against common attacks, which allows remote attackers to execute arbitrary commands or SQL by sending a legitimate value in a POST request or cookie, then specifying the attack string in the URL, which causes the getrequestvar function to return the wrong value in the $REQUEST variable, which is cleansed while the original malicious $GET value remains unmodified, as demonstrated in (1) graphimage.php and (2) graph.php.
config.php in Cacti 0.8.6e and earlier allows remote attackers to set the nohttpheaders switch, then modify session information to gain privileges and disable the use of addslashes to conduct SQL injection attacks.