CVE-2025-54138 LibreNMS has Authenticated Local File Inclusion in ajax_form.php that Allows RCE

High 7.5 Published Updated

Authenticated attackers can achieve remote code execution in LibreNMS via local file inclusion in ajax_form.php due to lack of input validation.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-54138?

CVE-2025-54138 is a high-severity code injection vulnerability in Librenms Librenms, published on 22 Jul 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official description

LibreNMS is an auto-discovering PHP/MySQL/SNMP based network monitoring which includes support for a wide range of network hardware and operating systems. LibreNMS versions 25.6.0 and below contain 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. 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 fixed in version 25.7.0.

Weakness: CWE-98

Which versions are affected by CVE-2025-54138?

2 open source packages ship an affected version, including librenms/librenms. It affects 1 product.

PackageAffectedFixed in
librenms/librenms PackagistAll versions25.7.0
librenms/librenms PackagistAll versions25.7.0

Products include Librenms Librenms.

How do I fix CVE-2025-54138?

Upgrade librenms/librenms to 25.7.0 or later.

Upgrade, and never evaluate templates, expressions or code built from user input. More about Code injection.

Is CVE-2025-54138 being exploited?

There is no known exploitation of CVE-2025-54138 in the wild and no public exploit code.

All Librenms Librenms vulnerabilities

Sources

Also known as GHSA-gq96-8w38-hhj2.

Is CVE-2025-54138 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free