/

CVE-2026-26988

Severity:

CRITICAL RISK

(9.1)

SQL Injection in LibreNMS ajax_table.php IPv6 Search

CVE-2026-26988

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Unauthorized Database Access and Manipulation

Severity:

CRITICAL RISK

(9.1)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

LibreNMS versions 25.12.0 and below contain an SQL injection vulnerability in the ajax_table.php endpoint when handling IPv6 address searches.

By abusing the unvalidated prefix portion of the address parameter, an attacker can inject arbitrary SQL, which may lead to unauthorized data access or database manipulation.

Affected context

This vulnerability appears in LibreNMS deployments that expose the ajax_table.php endpoint and support IPv6 address searching.

The issue arises when the application splits an IPv6 address parameter into an address and prefix and then directly concatenates the prefix into an SQL query string without proper validation or parameterization.

Installations where user-controlled search parameters are accepted and passed into the database layer without strict filtering are particularly at risk, especially when the database user has broad read or write privileges.

Exploit preconditions

  • Attack surface: HTTP requests to the ajax_table.php endpoint (typically over the web UI / API).
  • Required access: Ability to send crafted requests containing the address parameter; this could be authenticated or unauthenticated depending on how the instance is configured.
  • Trigger point: Execution of the IPv6 search logic that splits the address input and incorporates the prefix directly into the SQL query.
  • Why exploitation is possible: The prefix portion of the address parameter is concatenated into the SQL string without parameterization or adequate validation, allowing attacker-controlled SQL fragments to alter the intended query structure.

Why this happens

The underlying bug is a classic SQL injection pattern: dynamically building SQL query strings with untrusted data.

In this case, LibreNMS splits the user-supplied IPv6 address into an address and prefix component, then embeds the prefix directly in the SQL query text.

Because the prefix is not passed through a parameterized query interface or properly constrained to expected formats, it can inject control characters, operators, or additional SQL statements.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where user input is mixed with query logic rather than treated as data.

Potential impact

  • Unauthorized reading of monitoring and configuration data stored in the LibreNMS database.
  • Modification or deletion of database records, potentially impacting monitoring accuracy and device inventories.
  • Creation or alteration of user accounts or permissions if the schema and privileges allow it.
  • Leveraging database-level functions to move toward remote code execution in certain environments.
  • Disruption of monitoring operations through corrupted or tampered database state.

General mitigation guidance

Effective mitigation focuses on eliminating dynamic SQL construction with untrusted input and tightening database privileges:

  • Use parameterized queries or prepared statements for all user-supplied input, including search filters and prefixes.
  • Apply strict input validation and normalization on address-related fields, enforcing allowed formats (e.g., IPv6 notation and prefix length ranges) before reaching the database layer.
  • Centralize query construction through safe data access layers instead of building SQL strings inline in request handlers.
  • Configure the database user used by LibreNMS according to least-privilege principles, limiting access to only the necessary schemas and operations.
  • Add defense-in-depth controls such as query builders or ORM frameworks that discourage direct string concatenation.

How teams detect issues like this

Detection typically involves combining code-level and runtime perspectives:

  • Static analysis: Scan the codebase for SQL queries built via string concatenation, especially around parameters like address or prefix-handling logic; flag any use of concatenation instead of bound parameters.
  • Code review: Examine request handlers and AJAX endpoints for manual query assembly and ensure user input is passed through validation and parameterized query APIs.
  • Security testing: Use targeted input fuzzing and application security testing tools to exercise IPv6 search functionality and detect anomalous SQL behavior or errors.
  • Database monitoring: Monitor for unusual or complex queries originating from application accounts, including attempts at UNIONs, stacked queries, or manipulation of authentication-related tables.

Sources

SourceLink
github.comgithub.com/librenms/librenms/commit/15429580baba03ed1dd377bada1bde4b7a1175a1
github.comgithub.com/librenms/librenms/pull/18777
github.comgithub.com/librenms/librenms/security/advisories/GHSA-h3rv-q4rq-pqcv

Frequently asked

questions

Yes. If the ajax_table.php endpoint is reachable over the network and accepts the IPv6 address parameter from user input, an attacker can exploit the vulnerability through crafted HTTP requests.

That depends on how the LibreNMS instance is configured. If IPv6 search functionality is available to unauthenticated users, the attack can be anonymous; otherwise, any account with access to the vulnerable search feature may be able to exploit it.

The most robust fix is to replace all dynamic SQL string concatenation involving user input with parameterized queries and enforce strict validation on address and prefix fields, ensuring they match expected IPv6 and prefix-length formats before query execution.

Establish coding standards that mandate parameterized queries, introduce automated checks for string-built SQL in code reviews and CI pipelines, and apply rigorous input validation for all search and filter parameters, particularly those that interact directly with database queries.

Find out what's already
exploitable in your codebase.