CVE-2024-32480

7.2 HIGH

📋 TL;DR

This SQL injection vulnerability in LibreNMS allows attackers to manipulate database queries through the 'order' parameter, potentially extracting entire database contents. All LibreNMS instances running versions before 24.4.0 are affected. The vulnerability stems from insufficient input validation before SQL statement concatenation.

💻 Affected Systems

Products:
  • LibreNMS
Versions: All versions prior to 24.4.0
Operating Systems: Any OS running LibreNMS
Default Config Vulnerable: ⚠️ Yes
Notes: All default installations are vulnerable. No special configuration required for exploitation.

📦 What is this software?

⚠️ Risk & Real-World Impact

🔴

Worst Case

Complete database compromise including sensitive configuration data, user credentials, and network monitoring information leading to full system takeover.

🟠

Likely Case

Data exfiltration of sensitive information including device credentials, network topology, and user data.

🟢

If Mitigated

Limited impact with proper input validation and database permissions restricting query execution.

🌐 Internet-Facing: HIGH - Internet-facing instances are directly exploitable without authentication.
🏢 Internal Only: MEDIUM - Internal instances still vulnerable but require network access.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: LIKELY
Unauthenticated Exploit: ⚠️ Yes
Complexity: LOW

SQL injection via HTTP parameters requires minimal technical skill. No authentication needed.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: 24.4.0

Vendor Advisory: https://github.com/librenms/librenms/security/advisories/GHSA-jh57-j3vq-h438

Restart Required: No

Instructions:

1. Backup your LibreNMS installation and database. 2. Update to version 24.4.0 or later using git: 'git pull origin master'. 3. Run database updates: './daily.sh'. 4. Verify the update completed successfully.

🔧 Temporary Workarounds

Input Validation Filter

all

Add input validation for the 'order' parameter to restrict to allowed values only

Modify PHP code to validate 'order' parameter against whitelist of allowed column names

Web Application Firewall

all

Deploy WAF rules to block SQL injection patterns in HTTP requests

Configure WAF to detect and block SQL injection patterns in URL parameters

🧯 If You Can't Patch

  • Restrict network access to LibreNMS instances using firewall rules
  • Implement database user with minimal permissions (read-only where possible)

🔍 How to Verify

Check if Vulnerable:

Check LibreNMS version: 'grep 'version' /opt/librenms/includes/vars.php' or via web interface at /ajax_output.php?type=version

Check Version:

grep "\$config['version']" /opt/librenms/includes/vars.php

Verify Fix Applied:

Confirm version is 24.4.0 or later and check commit 83fe4b10c440d69a47fe2f8616e290ba2bd3a27c is present

📡 Detection & Monitoring

Log Indicators:

  • Unusual SQL queries in database logs
  • Multiple requests with 'order' parameter containing SQL keywords

Network Indicators:

  • HTTP requests with SQL injection patterns in 'order' parameter

SIEM Query:

source="web_access.log" AND ("order=SELECT" OR "order=UNION" OR "order=--" OR "order=/*")

🔗 References

📤 Share & Export