/

CVE-2026-26990

Severity:

HIGH RISK

(8.8)

SQL Injection in LibreNMS Address Search

CVE-2026-26990

Analyzed

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Authenticated Time-Based Blind SQL Injection Leading to Data Exposure and Potential Data Manipulation

Severity:

HIGH RISK

(8.8)

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

A time-based blind SQL injection vulnerability in LibreNMS allows authenticated users to manipulate database queries via the address parameter in address-search.inc.php.

By supplying crafted subnet prefix values, an attacker can alter query logic and infer sensitive database information from timing differences in responses.

Affected context

This vulnerability occurs in LibreNMS deployments using versions 25.12.0 and below, specifically within the address search functionality backed by a PHP/MySQL stack.

The issue is present when user-supplied address (subnet prefix) input is concatenated directly into SQL queries without parameter binding or proper sanitization.

It is only reachable through authenticated functionality, meaning any logged-in user with access to the affected search feature can reach the vulnerable code path.

Exploit preconditions

  • Attack surface: Web application interface for address or subnet search (typically authenticated dashboard or search form).
  • Required access: Valid authenticated LibreNMS account with permission to perform address searches.
  • Input vector: The address parameter (subnet prefix) submitted to address-search.inc.php.
  • Trigger point: Execution of the SQL query that embeds the attacker-controlled prefix directly into the WHERE clause or related SQL expression.
  • Why exploitation is possible: The application constructs SQL statements by concatenating raw user input instead of using prepared statements with parameter binding, enabling the attacker to inject conditional logic that impacts execution time and reveals data through timing side channels.

Why this happens

The core issue is direct string concatenation of user-controlled input into SQL statements, violating the principle of treating all external input as untrusted.

Rather than using prepared statements and bound parameters, the code interpolates the address (subnet prefix) value into the query text, which allows an attacker to introduce additional SQL syntax, including time-based conditional expressions.

This maps to CWE-89: Improper Neutralization of Special Elements used in an SQL Command ('SQL Injection'), where the application fails to correctly separate data from command logic in database interactions.

Potential impact

  • Extraction of sensitive database information (such as configuration data or user-related metadata) via time-based inference.
  • Enumeration of database structure, including table and column names.
  • Potential pivot into broader data manipulation, depending on the breadth of injection and database permissions.
  • Increased risk of chained attacks if database-stored secrets or credentials are discovered.
  • Degradation of service performance due to repeated time-based probing.

General mitigation guidance

Effective mitigation focuses on eliminating direct concatenation of user input into SQL and enforcing strong separation between data and command logic.

Recommended defensive patterns include:

  • Using parameterized queries or prepared statements for all database interactions, ensuring that user input is always bound as data, not as part of the SQL syntax.
  • Centralizing database access through an abstraction layer that enforces parameter binding and disallows raw query construction where possible.
  • Applying robust server-side validation and normalization for fields like IP addresses and subnet prefixes, reducing the chance that arbitrary SQL fragments can be injected.
  • Restricting database account privileges to the minimum required for the application's functions so that injected queries have limited effect.
  • Adopting secure coding guidelines and code review checklists that specifically flag dynamic SQL construction as a pattern requiring scrutiny.

How teams detect issues like this

Detection typically involves a combination of code-centric and behavior-centric approaches:

  • Static analysis: Apply SAST rules to identify dynamic SQL construction, particularly concatenation involving request parameters such as $_GET, $_POST, or equivalent variables feeding into query builders.
  • Code review signals: Treat any ad-hoc SQL assembly in PHP (e.g., string-based queries with embedded variables) as a review hotspot and verify that parameter binding or safe query APIs are used.
  • Runtime monitoring: Use application-level logging and database monitoring to spot unusually slow, repetitive, or patterned queries that may indicate time-based probing.
  • Security testing: Incorporate automated and manual SQL injection testing into CI/CD pipelines and regular security assessments, focusing on authenticated flows as well as public endpoints.
  • Policy enforcement: Establish coding standards that prohibit unparameterized queries and integrate automated checks in pull requests to enforce these standards.

Sources

SourceLink
github.comgithub.com/librenms/librenms/commit/15429580baba03ed1dd377bada1bde4b7a1175a1
github.comgithub.com/librenms/librenms/pull/18777
github.comgithub.com/librenms/librenms/security/advisories/GHSA-79q9-wc6p-cf92

Frequently asked

questions

Yes, it is remotely exploitable through the web interface, but only by users who can successfully authenticate and access the affected address search functionality.

The attacker needs a valid LibreNMS account with permissions to perform address or subnet searches. No elevated administrative privileges are strictly required as long as the vulnerable endpoint is accessible after login.

The most robust fix is to replace all dynamic SQL construction involving user input with parameterized queries or prepared statements, and to validate that inputs like subnet prefixes conform to strict expected formats before use.

Future prevention relies on adopting secure-by-default data access patterns: consistently using parameter binding, enforcing strict server-side validation on all user input, limiting database privileges, and integrating automated security checks and targeted code review practices into the development lifecycle.

Find out what's already
exploitable in your codebase.