CVE-2025-65093: Librenms/librenms SQL Injection Vulnerability

MODERATE
Advisory Identifier: GHSA-6pmj-xjxp-p8g9
CVSS 5.5
CWE-89
Published
Advisory Summary

CVE-2025-65093 is a MODERATE (CVSS 5.5) sql injection vulnerability (CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')) affecting Librenms/librenms libraries in the Packagist ecosystem. The issue involves librenms is vulnerable to sql injection (boolean-based blind) in hostname parameter in ajax_output.php endpoint. Remediation is available by upgrading affected packages to version 25.11.0.

CVE-2025-65093 at a Glance

CVE Identifier CVE-2025-65093
GHSA Identifier GHSA-6pmj-xjxp-p8g9
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection')
Affected Product Librenms/librenms
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 5.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required High (PR:H)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2025-65093

To remediate this vulnerability, upgrade all affected Librenms/librenms dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

librenms/librenms fixed: 25.11.0
Upgrade librenms/librenms to 25.11.0
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for librenms/librenms

How to Check if You Are Affected

To determine whether your application is affected by CVE-2025-65093, inspect your project dependencies for Librenms/librenms:

inspect dependencies for librenms/librenms

Analyze the terminal output to locate any version of Librenms/librenms in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 25.11.0), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the product constructs all or part of an sql command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended sql command when it is sent to a downstream component. without sufficient removal or quoting of sql syntax in user-controllable inputs, the generated sql query can cause those inputs to be interpreted as sql instead of ordinary user data. In Librenms/librenms, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

## 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

CVE-2025-65093 Affected Librenms/librenms Versions

1 component(s)
Fixed Versions:
25.11.0
Product / Package Ecosystem Affected Versions Fixed Version
librenms/librenms
Packagist
< 25.11.0
25.11.0

References

Frequently Asked Questions

What is CVE-2025-65093?
CVE-2025-65093 is a security vulnerability in Librenms/librenms involving LibreNMS is vulnerable to SQL Injection (Boolean-Based Blind) in hostname parameter in ajax_output.php endpoint under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection').
Which Librenms/librenms versions are affected?
Affected versions include releases prior to 25.11.0 across affected packages: librenms/librenms.
What version fixes CVE-2025-65093?
Upgrading to 25.11.0 (or the latest patched release for your respective branch) resolves the vulnerability.
Is librenms/librenms affected?
Yes, librenms/librenms is affected in releases prior to 25.11.0. Upgrade your dependency to 25.11.0 or later.
What is the CVSS score of CVE-2025-65093?
CVE-2025-65093 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N.
What CWE is associated with CVE-2025-65093?
CVE-2025-65093 is classified under CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection') (The product constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component. Without sufficient removal or quoting of SQL syntax in user-controllable inputs, the generated SQL query can cause those inputs to be interpreted as SQL instead of ordinary user data.).
How can I check Packagist dependencies for CVE-2025-65093?
Run the dependency tree command: 'inspect dependencies for librenms/librenms'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6pmj-xjxp-p8g9",
  "modified" : "2025-12-05T18:31:51Z",
  "published" : "2025-11-18T18:48:01Z",
  "aliases" : [ "CVE-2025-65093" ],
  "summary" : "LibreNMS is vulnerable to SQL Injection (Boolean-Based Blind) in hostname parameter in ajax_output.php endpoint",
  "details" : "## Summary\n\nA **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.\n\n---\n\n## Details\n\n- **Vulnerable Endpoint:** `GET /ajax_output.php\n   \n- **Parameter:** `hostname`\n\n- **Authentication Required:** Admin privileges required to access `/ajax_output.php` discovery endpoint\n\n- **Vulnerability type:** Boolean-Based Blind SQL Injection — input is concatenated into a SQL statement without proper escaping\n\n---\n\n## Description\n\nThe LibreNMS application uses the `hostname` parameter during device discovery operations to query the database for matching devices.  \nHowever, user-supplied data is concatenated directly into the SQL query within `/opt/librenms/includes/html/output/capture.inc.php` without adequate sanitization..\n\nThis allows attackers to modify the query logic using Boolean expressions.  \nWhen crafted conditions evaluate to **true**, the application behaves normally and returns the expected device data.  \nWhen conditions evaluate to **false**, the response is altered (e.g., the queried host is not found).\n\nThis difference in behavior confirms that the parameter’s value is being interpreted as SQL logic, demonstrating a **Boolean-Based Blind SQL Injection**.\n\nNote: 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.\n\n---\n\n## Proof of Concept (PoC)\n\n1 - **Authenticate with an administrator account.**  \nThe discovery endpoint `/ajax_output.php` is accessible only to users with admin-level privileges.\n\n2 - Access the following URL with the payload that evaluates to `TRUE`:\n\n```\nGET /ajax_output.php?id=capture&format=text&type=discovery&hostname=10.0.5.4'+AND+1=1+AND+'1'='1 HTTP/1.1\nHost: 10.0.5.5:8000\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\nReferer: http://10.0.5.5:8000/device/3/capture\nCookie: laravel_session=[ADMIN_SESSION_COOKIE]\nPriority: u=0\n```\n\n3 - Observe that the system returns the expected data and triggers the discovery process.\n\n<img width=\"1507\" height=\"666\" alt=\"image\" src=\"https://github.com/user-attachments/assets/584e871a-a01a-4bad-8e09-c6dcb0e6cd1d\" />\n\n4 - Now repeat the request with a `FALSE` condition:\n\n```\nGET /ajax_output.php?id=capture&format=text&type=discovery&hostname=10.0.5.4'+AND+1=2+AND+'1'='1 HTTP/1.1\nHost: 10.0.5.5:8000\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate\nConnection: keep-alive\nReferer: http://10.0.5.5:8000/device/3/capture\nCookie: laravel_session=[SESSION COOKIE]\nPriority: u=0\n```\n\n5 - Observe that the response is altered: no device is found, and no discovery is triggered.\n\n<img width=\"1496\" height=\"662\" alt=\"image\" src=\"https://github.com/user-attachments/assets/b7d227bd-0a37-4589-81b6-26cca5135837\" />\n\n### Query behavior observed in logs\n\n``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]``\n\nThe difference in output confirms that the injected Boolean logic is being executed by the database.\n\n---\n\n## Impact\n\nBoolean-based SQL Injection can have severe consequences depending on the deployment context:\n\n- **Data extraction:** Attackers can infer database data (schema, users, configuration) through Boolean inference techniques.\n    \n- **System compromise:** Database or application state could be manipulated if the injection is further exploited.\n    \n- **Information disclosure:** Reveals internal SQL structure and logic of the LibreNMS backend.\n    \n\n---\n\n## References\n\n- CWE-89 — Improper Neutralization of Special Elements used in an SQL Command (‘SQL Injection’)\n    \n- OWASP SQL Injection Prevention Cheat Sheet",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:L/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "librenms/librenms"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "25.11.0"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 25.10.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/librenms/librenms/security/advisories/GHSA-6pmj-xjxp-p8g9"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2025-65093"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/librenms/librenms"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-89" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2025-11-18T18:48:01Z",
    "nvd_published_at" : "2025-11-18T23:15:57Z"
  }
}