Media

LibreNMS is vulnerable to SQL Injection (Boolean-Based Blind) in hostname parameter in ajax_output.php endpoint

  • Publicada: 18.11.2025
  • Actualizado: 11.10.2026 10:22

Summary

A Boolean-Based Blind SQL Injection vulnerability was identified in the LibreNMS application at the /ajax_output.php endpoint. The hostname parameter is interpolated directly into an SQL query without proper sanitization or parameter binding, allowing an attacker to manipulate the query logic and infer data from the database through conditional responses.


Details

  • Vulnerable Endpoint: `GET /ajax_output.php

  • Parameter: hostname

  • Authentication Required: Admin privileges required to access /ajax_output.php discovery endpoint

  • Vulnerability type: Boolean-Based Blind SQL Injection — input is concatenated into a SQL statement without proper escaping


Description

The LibreNMS application uses the hostname parameter during device discovery operations to query the database for matching devices.
However, user-supplied data is concatenated directly into the SQL query within /opt/librenms/includes/html/output/capture.inc.php without adequate sanitization..

This allows attackers to modify the query logic using Boolean expressions.
When crafted conditions evaluate to true, the application behaves normally and returns the expected device data.
When conditions evaluate to false, the response is altered (e.g., the queried host is not found).

This difference in behavior confirms that the parameter’s value is being interpreted as SQL logic, demonstrating a Boolean-Based Blind SQL Injection.

Note: This vulnerability requires an authenticated user with administrator privileges to access the affected discovery functionality. While this limits exploitation to internal or compromised admin sessions, the vulnerability still represents a critical security risk due to the ability to manipulate backend SQL logic in privileged contexts.


Proof of Concept (PoC)

1 - Authenticate with an administrator account.
The discovery endpoint /ajax_output.php is accessible only to users with admin-level privileges.

2 - Access the following URL with the payload that evaluates to TRUE:

GET /ajax_output.php?id=capture&format=text&type=discovery&hostname=10.0.5.4'+AND+1=1+AND+'1'='1 HTTP/1.1
Host: 10.0.5.5:8000
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://10.0.5.5:8000/device/3/capture
Cookie: laravel_session=[ADMIN_SESSION_COOKIE]
Priority: u=0

3 - Observe that the system returns the expected data and triggers the discovery process.

<img width="1507" height="666" alt="image" src="https://github.com/user-attachments/assets/584e871a-a01a-4bad-8e09-c6dcb0e6cd1d" />

4 - Now repeat the request with a FALSE condition:

GET /ajax_output.php?id=capture&format=text&type=discovery&hostname=10.0.5.4'+AND+1=2+AND+'1'='1 HTTP/1.1
Host: 10.0.5.5:8000
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate
Connection: keep-alive
Referer: http://10.0.5.5:8000/device/3/capture
Cookie: laravel_session=[SESSION COOKIE]
Priority: u=0

5 - Observe that the response is altered: no device is found, and no discovery is triggered.

<img width="1496" height="662" alt="image" src="https://github.com/user-attachments/assets/b7d227bd-0a37-4589-81b6-26cca5135837" />

Query behavior observed in logs

SQL[SELECT * FROM `devices` WHERE disabled = 0 AND `hostname` LIKE '10.0.5.4' AND 1=1 AND '1'='1' ORDER BY device_id DESC [] 0.5ms]

The difference in output confirms that the injected Boolean logic is being executed by the database.


Impact

Boolean-based SQL Injection can have severe consequences depending on the deployment context:

  • Data extraction: Attackers can infer database data (schema, users, configuration) through Boolean inference techniques.

  • System compromise: Database or application state could be manipulated if the injection is further exploited.

  • Information disclosure: Reveals internal SQL structure and logic of the LibreNMS backend.


References

  • CWE-89 — Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)

  • OWASP SQL Injection Prevention Cheat Sheet

Software afectado

Haz clic en una tecnología para ver todas sus vulnerabilidades.

PlataformaPaqueteVersiones vulnerablesCorregida en
Paquete de Composer librenms/librenms < 25.11.0 25.11.0

Referencias

Puntuación CVSS 5.5/10
Vector CVSS
CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N
Debilidad (CWE)
CWE-89
Plataforma
Composer
Paquete
librenms/librenms
Publicada
18.11.2025
Actualizado
11.10.2026 10:22

Fuentes y licencias

OSV / GitHub Advisory Database - GHSA-6pmj-xjxp-p8g9 - CC BY 4.0

Historial de vulnerabilidades: librenms/librenms

Todas las vulnerabilidades publicadas de este paquete (Paquete de Composer), de la más reciente a la más antigua. Muestra si es un fallo aislado o un paquete que hay que vigilar.

Todas (106) en el archivo
Entradas en total
106
Primera → última
10.2019 08.2026
Sin corrección
6
Explotada en ataques
0

Distribución por gravedad

  • Crítica 5
  • Alta 39
  • Media 56
  • Baja 6

Divulgaciones por año

  1. 2019: 6
  2. 2020: 0
  3. 2021: 7
  4. 2022: 26
  5. 2023: 12
  6. 2024: 24
  7. 2025: 15
  8. 2026: 16
Gravedad:
  1. Alta · 7.1 CVE-2026-84192 < 26.5.0 26.5.0
  2. Alta · 7.1 CVE-2020-36947 <= 1.46 sin corrección
  3. LibreNMS is vulnerable to SQL Injection (Boolean-Based Blind) in hostname parameter in ajax_output.php endpoint esta entrada
    Media · 5.5 CVE-2025-65093 < 25.11.0 25.11.0
  4. Crítica · 9.1 CVE-2024-51092 < 24.10.0 24.10.0
  5. Alta · 7.8 CVE-2023-5591 < 23.10.0 23.10.0
  6. Alta · 8.4 CVE-2023-5060 < 23.9.1 23.9.1
  7. Alta · 7.6 CVE-2023-4347 < 23.8.0 23.8.0
  8. Alta · 8.8 CVE-2022-3525 < 22.10.0 22.10.0
  9. Alta · 7.6 CVE-2022-4068 < 22.10.0 22.10.0
  10. Crítica · 9.8 CVE-2022-4070 < 22.10.0 22.10.0
  11. Alta CVE-2022-29712 < 22.4.0 22.4.0
  12. Crítica · 9.8 CVE-2019-10665 <= 1.47 sin corrección
  13. Crítica · 9.8 CVE-2018-20434 = 1.46 sin corrección
  14. Alta · 8.8 CVE-2018-20678 < 1.65 1.65
  15. Alta · 7.1 CVE-2022-0580 < 22.2.0 22.2.0
  16. Alta · 7.1 CVE-2022-0587 < 22.2.0 22.2.0
  17. Crítica · 9.8 CVE-2021-44278 <= 21.11.0 sin corrección
  18. Alta · 8.8 CVE-2020-15877 < 1.65.1 1.65.1
Mostrar más (5) Mostrando 40 de 45

Identifica las vulnerabilidades de tu aplicación

Con la integración de DockRay y el inventario de software activado, DockRay compara las versiones notificadas de los componentes con las vulnerabilidades conocidas y avisa de las coincidencias confirmadas. La cobertura depende de la tecnología compatible y de los avisos disponibles.

Conectar tu aplicación
Newsletter DockRay

La seguridad de tus aplicaciones en tu correo

Vulnerabilidades importantes, recomendaciones concretas y consejos prácticos para tus aplicaciones. Elige tus tecnologías y sigue lo que importa para tu proyecto.

  • Un resumen diario de nuevas vulnerabilidades, también las críticas.
  • Avisos sobre actualizaciones importantes.
  • Consejos prácticos sobre seguridad y monitorización de aplicaciones.

Déjalo vacío para recibir avisos de todas las tecnologías.

Suscripción gratuita. Date de baja con un clic en cualquier correo.