Summary
A SQL injection vulnerability in automation_get_new_graphs_sql
function of api_automation.php
allows authenticated users to exploit these SQL injection vulnerabilities to perform privilege escalation and remote code execution.
Details
In
|
$sql_having = build_graph_object_sql_having($rule, get_request_var('filter')); |
, The
get_request_var('filter')
is being concatenated into the SQL statement without any sanitization. In
|
'filter' => FILTER_DEFAULT, |
, The filter of
'filter'
is
FILTER_DEFAULT
, which means there is no filter for it.
PoC
Create a rule in automation_graph_rules.php
like this:
![image](https://user-images.githubusercontent.com/12847578/295564383-936d3516-7c67-404e-b96d-7470a8c791fb.png)
Visit http://localhost/cacti/automation_graph_rules.php?action=edit&id=2&page=1&filter=%25%22);select%20sleep(10)--+)
![image](https://user-images.githubusercontent.com/12847578/295561383-ce753e9f-671f-48fa-91f2-7b26c923793e.png)
![image](https://user-images.githubusercontent.com/12847578/295561700-a5485005-a803-4e04-9800-83181c80c275.png)
Summary
A SQL injection vulnerability in
automation_get_new_graphs_sql
function ofapi_automation.php
allows authenticated users to exploit these SQL injection vulnerabilities to perform privilege escalation and remote code execution.Details
In
cacti/lib/api_automation.php
Line 856 in 5017129
get_request_var('filter')
is being concatenated into the SQL statement without any sanitization. Incacti/lib/api_automation.php
Line 717 in 5017129
'filter'
isFILTER_DEFAULT
, which means there is no filter for it.PoC
Create a rule in
automation_graph_rules.php
like this:Visit http://localhost/cacti/automation_graph_rules.php?action=edit&id=2&page=1&filter=%25%22);select%20sleep(10)--+)