CVE-2025-54399
Executive Summary
CVE-2025-54399 is a critical stack-based buffer overflow vulnerability in the Planet WGR-500 router firmware version v1.3411b190912. The flaw resides in the formPingCmd functionality, specifically within the handling of the ipaddr HTTP request parameter. An unauthenticated attacker can trigger a stack-based buffer overflow by sending a specially crafted series of HTTP requests, leading to arbitrary code execution with root privileges. The vulnerability is unpatched, and no public exploit code or proof-of-concept is currently available. The EPSS score is 0.0%, indicating low exploitation activity in the wild, but the high CVSS score (8.8) and the lack of a patch make this a significant risk for affected devices.
This record — and 170,000+ others — are available via the ValtersIT API. One endpoint replaces five: NVD + GitHub CVE + CISA KEV + EPSS + Nuclei + Exploit-DB, unified.
No signup required
CVSS Breakdown & Threat Level
- CVSS Score: 8.8 (High)
- Attack Vector: Network (AV:N)
- Attack Complexity: Low (AC:L)
- Privileges Required: None (PR:N)
- User Interaction: None (UI:N)
- Scope: Unchanged (S:U)
- Confidentiality Impact: High (C:H)
- Integrity Impact: High (I:H)
- Availability Impact: High (A:H)
Threat Level: Critical. The vulnerability allows remote, unauthenticated attackers to execute arbitrary code on the device, potentially leading to full device compromise, network pivoting, and data exfiltration.
Deep Dive & Mechanics
The vulnerability is a classic stack-based buffer overflow in the formPingCmd function of the Planet WGR-500 web server. The function constructs a system command string using the ipaddr parameter from an HTTP POST request:
ping -c <counts> <ipaddr> 2>&1 > %s &
The ipaddr parameter is copied into a fixed-size stack buffer without proper bounds checking. By sending an overly long ipaddr value, an attacker can overwrite the return address and other critical stack data, achieving arbitrary code execution. The counts parameter is also user-controlled but is not the primary vector for this overflow.
The vulnerability is triggered by sending a series of HTTP requests, each containing a malicious ipaddr value. The overflow occurs during the string formatting operation, allowing the attacker to control the instruction pointer.
Vulnerable vs. Patched Code
Vulnerable Code (Conceptual):
void formPingCmd(char *ipaddr, int counts) {
char cmd[256];
snprintf(cmd, sizeof(cmd), "ping -c %d %s 2>&1 > /tmp/ping_result &", counts, ipaddr);
system(cmd);
}
The snprintf function does not limit the size of the ipaddr parameter, allowing it to overflow the cmd buffer.
Patched Code (Hypothetical):
void formPingCmd(char *ipaddr, int counts) {
char cmd[256];
// Validate and truncate ipaddr
if (strlen(ipaddr) > 200) {
// Log error and return
return;
}
snprintf(cmd, sizeof(cmd), "ping -c %d %s 2>&1 > /tmp/ping_result &", counts, ipaddr);
system(cmd);
}
A proper patch would include input validation, bounds checking, and the use of safer functions like snprintf with explicit length limits.
Exploitation & Lab Setup
Red Team
Lab Setup:
- Obtain a Planet WGR-500 router with firmware v1.3411b190912.
- Connect the router to a isolated network segment.
- Use a tool like
curlor a custom Python script to send HTTP POST requests to the vulnerable endpoint.
Exploitation Steps:
- Identify the vulnerable endpoint:
http://<router-ip>/goform/formPingCmd - Craft a payload that overflows the
ipaddrparameter. The payload should include shellcode to execute arbitrary commands. - Send the malicious request:
curl -X POST http://192.168.1.1/goform/formPingCmd \ -d "ipaddr=$(python3 -c 'print("A"*300 + "\x90"*16 + "<shellcode>")')&counts=1" - The overflow overwrites the return address, redirecting execution to the shellcode.
Note: Since no public exploit code is available, this is a conceptual approach. Actual exploitation would require reverse engineering the firmware to determine the exact buffer size and offset to the return address.
Blue Team
Detection:
- Monitor for HTTP POST requests to
/goform/formPingCmdwith abnormally longipaddrparameters. - Use network intrusion detection systems (NIDS) to alert on patterns indicative of buffer overflow attempts.
- Enable logging on the router (if possible) to capture failed ping command executions.
Mitigation:
- Isolate affected devices on a separate VLAN.
- Implement strict input validation at the network perimeter.
- Monitor for outbound connections from the router to unknown IP addresses, which may indicate successful exploitation.
Indicators of Compromise (IOCs)
Network:
- HTTP POST requests to
/goform/formPingCmdwithipaddrparameter exceeding 200 characters. - Unusual ICMP traffic originating from the router.
- Connections to unknown external IP addresses from the router.
- HTTP POST requests to
Host:
- Unexpected processes running on the router (e.g., reverse shells).
- Modified system binaries or configuration files.
- Presence of
/tmp/ping_resultfile with unexpected content.
Logs:
- Repeated failed ping command executions in system logs.
- Crash dumps or kernel panics related to the web server.
Detection Engineering
YARA Rule
rule CVE_2025_54399_Planet_WGR500_Overflow {
meta:
description = "Detects HTTP requests targeting the formPingCmd buffer overflow in Planet WGR-500"
author = "Valters IT"
date = "2025-04-01"
reference = "CVE-2025-54399"
strings:
$http_method = "POST"
$uri = "/goform/formPingCmd"
$ipaddr_param = "ipaddr="
$long_string = /ipaddr=[A-Za-z0-9%]{200,}/
condition:
$http_method and $uri and $ipaddr_param and $long_string
}
Sigma Rule
title: CVE-2025-54399 Planet WGR-500 Buffer Overflow Attempt
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests with long ipaddr parameter to formPingCmd
author: Valters IT
date: 2025-04-01
logsource:
category: webserver
product: apache
detection:
selection:
cs-method: 'POST'
cs-uri-stem: '/goform/formPingCmd'
cs-uri-query|contains: 'ipaddr='
cs-uri-query|length: >= 250
condition: selection
falsepositives:
- Legitimate long IP addresses (unlikely)
level: high
Suricata Rule
alert http $HOME_NET any -> $EXTERNAL_NET any (
msg:"CVE-2025-54399 Planet WGR-500 Buffer Overflow Attempt";
flow:to_server,established;
content:"POST"; http_method;
content:"/goform/formPingCmd"; http_uri;
content:"ipaddr="; http_client_body;
pcre:"/ipaddr=[A-Za-z0-9%]{250,}/";
sid:1000001;
rev:1;
reference:cve,2025-54399;
classtype:attempted-admin;
priority:1;
)
Remediation & Mitigation
Immediate Actions:
- Isolate affected devices: Place Planet WGR-500 routers on a separate VLAN with restricted access.
- Disable remote management: If not required, disable the web interface on the WAN side.
- Monitor for exploitation: Deploy the provided detection rules to identify potential attacks.
Long-term Fix:
- Vendor patch: Contact Planet for a firmware update. Since no patch is available, consider replacing the device with a supported alternative.
- Workaround: If patching is not possible, implement a reverse proxy or WAF to filter malicious requests to the vulnerable endpoint.
Valters IT Signature: This report is provided for educational and defensive purposes only. Unauthorized exploitation of this vulnerability is illegal. Always obtain proper authorization before testing or deploying countermeasures.
Valters IT
💣 PoC CODE AVAILABLE
Exploit code for this CVE is tracked in our database.
Access poc_code via API Pro.