/

CVE-2020-15878

Severity:

HIGH RISK

(8.8)

SQL Injection (CWE-89) in LibreNMS ajax_table.php API

CVE-2020-15878

Deferred

Vulnerability type

Category:

SQL Injection

CWE:

CWE-89

Impact:

Database Information Disclosure

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

LibreNMS 1.65 contains a SQL injection vulnerability in the address parameter handled by the /ajax_table.php API endpoint. A remote authenticated attacker with normal privileges may manipulate database queries and extract information from the LibreNMS database.

Affected context

The vulnerability occurs in LibreNMS deployments using the affected /ajax_table.php API endpoint, where user-controlled address data is incorporated into database queries without sufficient separation from SQL syntax. Exploitation is relevant when an attacker can authenticate with an account having normal privileges and reach the endpoint.

Exploit preconditions

  • Attack surface: The remotely accessible /ajax_table.php API endpoint
  • Required access: A valid authenticated account with normal privileges
  • Trigger point: Processing of attacker-controlled input in the address parameter
  • Why exploitation is possible: Input may influence database query behavior because it is not adequately isolated from the underlying SQL statement

Why this happens

The underlying bug is an unsafe construction or handling of SQL queries using externally controlled input. When application data is interpreted as part of a database command rather than treated strictly as a value, an attacker may alter query behavior. This corresponds to CWE-89: Improper Neutralization of Special Elements used in an SQL Command, commonly known as SQL injection.

Potential impact

  • An attacker may extract sensitive information from the LibreNMS database.
  • Database credentials, monitoring data, device details, or user information could be exposed.
  • Query manipulation could affect the confidentiality and integrity of stored application data.
  • The vulnerability could support further compromise if exposed database information includes reusable secrets.

General mitigation guidance

Mitigation generally focuses on ensuring that all database queries treat external input as data rather than executable SQL.

Common defensive patterns include:

  • Using parameterized queries or prepared statements for database access.
  • Avoiding string concatenation when constructing SQL statements.
  • Applying allowlist-based validation appropriate to the expected address format.
  • Limiting database account privileges to only the operations required by the application.
  • Restricting endpoint access and requiring authentication and authorization checks by default.
  • Reducing the sensitivity and exposure of data returned by API responses.

How teams detect issues like this

Organizations commonly detect SQL injection risks through:

  • Static analysis rules that identify query construction through string concatenation or interpolation.
  • Code review checks for unparameterized database calls and inconsistent input handling.
  • Web application monitoring for abnormal query parameters, repeated database errors, or unusual API response patterns.
  • Database audit logs that reveal unexpected query structures or broad data-access behavior.
  • Policy enforcement requiring prepared statements and approved database-access abstractions.

Automated application security testing and neutral code-review tools may help identify unsafe query patterns during development.

Sources

SourceLink
community.librenms.orgcommunity.librenms.org/c/announcements
github.comgithub.com/librenms/librenms/compare/1.65...1.65.1
github.comgithub.com/librenms/librenms/releases/tag/1.65.1
shielder.itshielder.it/blog
shielder.comshielder.com/advisories/librenms-address-authenticated-sql-injection/

Frequently asked

questions

Yes, the affected API endpoint can be reached remotely, but exploitation generally requires an authenticated account with normal privileges.

The attacker needs valid LibreNMS authentication and sufficient access to invoke the vulnerable endpoint. Anonymous access alone is not assumed.

Use parameterized queries or prepared statements so that address values cannot alter SQL command structure, combined with strict validation of expected input.

Standardize database access through secure abstractions, review every query that incorporates external input, enforce least-privilege database permissions, and monitor API and database activity for anomalous behavior.

Find out what's already
exploitable in your codebase.