Описание
LibreNMS vulnerable to a Time-Based Blind SQL injection leads to database extraction
Summary
Get a valid API token, make sure you can access api functions, then replace string on my PoC code, Test on offical OVA image, it's a old version 23.9.1, but this vulerable is also exists on latest version 24.2.0
Details
in file api_functions.php, line 307 for function list_devices
The "order" parameter is obtained from $request. After performing a string check, the value is directly incorporated into an SQL statement and concatenated, resulting in a SQL injection vulnerability.
PoC
For example. this PoC is get current db user
Impact
Attacker can extract whole database
Пакеты
librenms/librenms
< 24.4.0
24.4.0
Связанные уязвимости
LibreNMS is an open-source, PHP/MySQL/SNMP-based network monitoring system. Versions prior to 24.4.0 are vulnerable to SQL injection. The `order` parameter is obtained from `$request`. After performing a string check, the value is directly incorporated into an SQL statement and concatenated, resulting in a SQL injection vulnerability. An attacker may extract a whole database this way. Version 24.4.0 fixes the issue.