GHSA-H3RV-Q4RQ-PQCV

Vulnerability from github – Published: 2026-02-18 22:30 – Updated: 2026-02-18 22:30
VLAI?
Summary
LibreNMS: SQL Injection in ajax_table.php spreads through a covert data stream.
Details

Summary

SQL Injection in IPv6 Address Search functionality via address parameter*

A SQL injection vulnerability exists in the ajax_table.php endpoint. The application fails to properly sanitize or parameterize user input when processing IPv6 address searches. Specifically, the address parameter is split into an address and a prefix, and the prefix portion is directly concatenated into the SQL query string without validation. This allows an attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access or database manipulation.

Details

The vulnerability is located in the logic that handles address searching when search_type is set to ipv6.

The application takes the user-supplied address parameter and splits it using the / delimiter:

[$address, $prefix] = explode('/', $vars['address']);

If the search_type is ipv6 and the $prefix variable is not empty, the code constructs the SQL query by directly concatenating the $prefix variable into the string:

} elseif ($vars['search_type'] == 'ipv6') {
    // ... code omitted ...
    if (! empty($prefix)) {
        // VULNERABILITY: Direct concatenation of user input
        $sql .= " AND ipv6_prefixlen = '$prefix'";
    }
}

Unlike the ipv4 block, which attempts to use prepared statements (binding parameters via $param[]), the ipv6 block treats the prefix as a raw string. By supplying an input containing a /, an attacker can populate the $prefix variable. If this variable contains single quotes ('), it breaks out of the string literal in the SQL statement, enabling SQL injection.

Vulnerable Code Snippet:

if (! empty($prefix)) {
    $sql .= " AND ipv6_prefixlen = '$prefix'";
}

PoC

To reproduce this vulnerability, an attacker can send a specially crafted HTTP POST request to the ajax_table.php endpoint.

Payload breakdown:

  • search_type=ipv6: Forces the execution flow into the vulnerable elseif block.

  • address=snow/1nd'":

  • The explode function splits this into $address = 'snow' and $prefix = "1nd'"".

  • The SQL query becomes: ... AND ipv6_prefixlen = '1nd'"'.

  • The single quote ' closes the string definition in the SQL query, and the subsequent characters allow for SQL syntax manipulation.

Reproduction Steps:

  1. Access the application instance.

  2. Send the following request (adjusting the host as necessary):

POST /ajax_table.php HTTP/1.1
Host: localhost
id=address-search&search_type=ipv6&address=snow/1nd'" 

Impact

This vulnerability allows an attacker to execute arbitrary SQL queries against the database.

Show details on source website

{
  "affected": [
    {
      "package": {
        "ecosystem": "Packagist",
        "name": "librenms/librenms"
      },
      "ranges": [
        {
          "events": [
            {
              "introduced": "0"
            },
            {
              "fixed": "26.2.0"
            }
          ],
          "type": "ECOSYSTEM"
        }
      ]
    }
  ],
  "aliases": [
    "CVE-2026-26988"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-18T22:30:18Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\n*SQL Injection in IPv6 Address Search functionality via `address` parameter**\n\nA SQL injection vulnerability exists in the `ajax_table.php` endpoint. The application fails to properly sanitize or parameterize user input when processing IPv6 address searches. Specifically, the `address` parameter is split into an address and a prefix, and the prefix portion is directly concatenated into the SQL query string without validation. This allows an attacker to inject arbitrary SQL commands, potentially leading to unauthorized data access or database manipulation.\n\n### Details\nThe vulnerability is located in the logic that handles address searching when `search_type` is set to `ipv6`.\n\nThe application takes the user-supplied `address` parameter and splits it using the `/` delimiter:\n```PHP\n[$address, $prefix] = explode(\u0027/\u0027, $vars[\u0027address\u0027]);\n```\nIf the search_type is ipv6 and the $prefix variable is not empty, the code constructs the SQL query by directly concatenating the $prefix variable into the string:\n```\n} elseif ($vars[\u0027search_type\u0027] == \u0027ipv6\u0027) {\n    // ... code omitted ...\n    if (! empty($prefix)) {\n        // VULNERABILITY: Direct concatenation of user input\n        $sql .= \" AND ipv6_prefixlen = \u0027$prefix\u0027\";\n    }\n}\n```\nUnlike the ipv4 block, which attempts to use prepared statements (binding parameters via $param[]), the ipv6 block treats the prefix as a raw string. By supplying an input containing a /, an attacker can populate the $prefix variable. If this variable contains single quotes (\u0027), it breaks out of the string literal in the SQL statement, enabling SQL injection.\n\nVulnerable Code Snippet:\n```\nif (! empty($prefix)) {\n    $sql .= \" AND ipv6_prefixlen = \u0027$prefix\u0027\";\n}\n```\n### PoC\nTo reproduce this vulnerability, an attacker can send a specially crafted HTTP POST request to the ajax_table.php endpoint.\n\nPayload breakdown:\n\n- search_type=ipv6: Forces the execution flow into the vulnerable elseif block.\n\n- address=snow/1nd\u0027\":\n\n  - The explode function splits this into $address = \u0027snow\u0027 and $prefix = \"1nd\u0027\"\".\n\n  - The SQL query becomes: ... AND ipv6_prefixlen = \u00271nd\u0027\"\u0027.\n\n  - The single quote \u0027 closes the string definition in the SQL query, and the subsequent characters allow for SQL syntax manipulation.\n\nReproduction Steps:\n\n1. Access the application instance.\n\n2. Send the following request (adjusting the host as necessary):\n```\nPOST /ajax_table.php HTTP/1.1\nHost: localhost\nid=address-search\u0026search_type=ipv6\u0026address=snow/1nd\u0027\" \n```\n### Impact\nThis vulnerability allows an attacker to execute arbitrary SQL queries against the database.",
  "id": "GHSA-h3rv-q4rq-pqcv",
  "modified": "2026-02-18T22:30:18Z",
  "published": "2026-02-18T22:30:18Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/security/advisories/GHSA-h3rv-q4rq-pqcv"
    },
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/pull/18777"
    },
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/commit/15429580baba03ed1dd377bada1bde4b7a1175a1"
    },
    {
      "type": "PACKAGE",
      "url": "https://github.com/librenms/librenms"
    }
  ],
  "schema_version": "1.4.0",
  "severity": [],
  "summary": "LibreNMS: SQL Injection in ajax_table.php spreads through a covert data stream."
}


Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Sightings

Author Source Type Date

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.


Loading…

Detection rules are retrieved from Rulezet.

Loading…

Loading…