Automated Threat Modeling

Brief Summary: Tenda AX9 CVE-2026-138417 Unauthenticated OS Command Injection in setMacFilterCfg

A brief summary of CVE-2026-138417, an unauthenticated second-order OS command injection in Tenda AX9 firmware V22.03.01.46 that chains an authentication bypass with stored configuration data to reach root command execution. Includes the publicly disclosed proof of concept.

CVE Analysis

8 min read

Gaurav Sarraf
Gaurav Sarraf

2026-11-30

Brief Summary: Tenda AX9 CVE-2026-138417 Unauthenticated OS Command Injection in setMacFilterCfg

Introduction

A single configuration field in a consumer WiFi router can turn into a root shell, and two plaintext HTTP requests are enough to reach it. CVE-2026-138417 chains an authentication bypass with a second-order OS command injection in Tenda's AX9 router, letting an unauthenticated attacker on the network run commands as root in the demonstrated emulation environment.

Tenda is a Shenzhen-based networking vendor founded in 1999. Its portfolio spans home and business routers, switches, broadband customer premises equipment, gateways, and IP cameras, with distribution reported to more than 100 countries. The AX9 is one of its WiFi 6 home routers, and its Web Management Backend is the component affected here. Routers like this sit directly on the network edge for many households and small offices, so flaws in their management interfaces are a recurring source of high-impact vulnerabilities.

Technical Information

The vulnerability affects the system-based handling of /goform/setMacFilterCfg in the Web Management Backend of Tenda AX9 firmware V22.03.01.46. The classifications are CWE-77 (Command Injection) and CWE-78 (OS Command Injection). This case combines a second-order (stored) injection with a pre-authentication routing flaw, so neither defect alone tells the whole story.

Root cause

The request is handled by formSetMacFilterCfg (identified as sub_42F69C in httpd, which runs as root). The attacker-controlled macFilterType is written into the device configuration through td_serverd, and the dangerous behavior occurs when a later request changes the value: the previously stored value is concatenated, unsanitized, into a shell command. The report presents the following decompiled logic:

v2 = sub_415C94(a1, "macFilterType", ""); // new type (attacker input) tapi_get_mf_cfg(...); // read stored old type into v17[2] tapi_set_mf_cfg(v15[0]); // new type persisted via RPC if ( strcmp(v2, &v17[2]) ) // when new != old doSystemCmd("echo %s >/tmp/macfilter", &v17[2]); // old value -> shell, unfiltered

The storage routine set_mf_cfg in td_serverd only enforces a length limit (strlen+1 < 17 bytes) and does not filter backticks, $(), or ;, so a backtick payload is stored verbatim. doSystemCmd ultimately calls system(), which invokes /bin/sh -c. Its only injection check requires the candidate string to contain both liuguizhou and telnetd at the same time, a condition that is trivially avoided. Because the Web service runs as root, the injected command inherits root privileges.

The second-order nature is the point. The first request plants the payload in configuration storage, and the second request, which changes the type and triggers the echo, causes the stored value to be executed. The report also notes that an overlength value can trip a backend trap and crash instead, so the technique is constrained by the 16-byte configuration field size.

Authentication bypass

The exploit becomes fully unauthenticated by chaining CVE-2023-47422. R7WebsSecurityHandler uses strstr substring matching against static-resource names, so appending ?img/main-logo.png to any URL makes the request bypass authentication checks. With no active session, the request body is processed as plaintext, requiring no login and no AES or signature.

Attack flow

  1. The attacker sends a POST to /goform/setMacFilterCfg?img/main-logo.png, bypassing authentication through the substring match, with a macFilterType value containing a backtick-wrapped command (16 bytes or fewer including the backticks). This is stored verbatim via td_serverd.
  2. The attacker sends a second POST that sets macFilterType=black. Since the new value differs from the stored value, the previously stored backtick payload is inserted unquoted into echo %s >/tmp/macfilter and executed through system() and /bin/sh -c.
  3. The command runs as root. The researcher observed uid=0(root) gid=0(root) groups=0(root) from an id payload in a QEMU user-mode chroot emulation of the httpd plus td_serverd stack.

The 16-byte field limit is worked around by building a longer script character by character using printf "c">>1 across multiple requests, which the report describes as a path toward staging a reverse shell or enabling telnet. The complete reverse shell chain is described as a subsequent step rather than a demonstrated result.

Proof of Concept

A working public PoC is directly referenced from the authoritative CVE record. The NVD entry describes the OS command injection via macFilterType in /goform/setMacFilterCfg, states the attack is remote, and links to the researcher's GitHub report as the disclosed exploit. VulDB classifies the exploit maturity as proof of concept with the CVSS 4.0 vector AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:H/VA:H/SC:H/SI:H/SA:H/E:P (9.3 Critical).

Step 1, write the backtick-wrapped command (16 bytes or fewer including backticks):

curl -X POST "http://127.0.0.1/goform/setMacFilterCfg?img/main-logo.png" \ -d $'macFilterType=`id>/tmp/pwn`&deviceList=jdsfs\r10:10:10:10:10:10'

Step 2, change the type back to black to trigger the echo of the old value, executing the backtick content:

curl -X POST "http://127.0.0.1/goform/setMacFilterCfg?img/main-logo.png" \ -d $'macFilterType=black&deviceList=jdsfs\r10:10:10:10:10:10'

Step 3, the command runs as root; the report's observed output of id is uid=0(root) gid=0(root) groups=0(root).

A Python PoC (ax9_exp.py) automates the two-request injection, and the 16-byte limit is bypassed by building a longer script character by character with printf "c">>1 to stage a reverse shell or enable telnet. Testing was done in a QEMU user-mode chroot emulation of the httpd plus td_serverd stack.

An earlier authenticated variant of the same setMacFilterCfg / macFilterType command execution bug (affecting AX9 and AX12 V1.0 V22.03.01.46) was published as a public gist by Swind1er. It includes an authenticated AES-CBC exploit (hard-coded IV EU5H62G9ICGRNI43) that writes a script char by char via printf, chmod 777s it, executes it, and runs passwd -d root plus telnetd for persistence. The nenghun report builds on this by adding the pre-auth bypass, making the chain fully unauthenticated.

Affected Systems and Versions

The formal CVE record identifies Tenda AX9 firmware V22.03.01.46, the Web Management Backend, the route /goform/setMacFilterCfg, and the argument macFilterType. The researcher analyzes AX9 V1.0 firmware US_AX9V1.0in_V22.03.01.46_cn_TDC01.bin and additionally states that AX12 V1.0 shares the affected firmware or codebase; that AX12 claim belongs to the research report, while the formal affected product listing names AX9. Other AX9 firmware versions are not established as affected by this record. The reviewed records do not identify a fixed version.

Vendor Security History

Tenda's history shows both serious defects and evidence of remediation, but the outcomes are product specific:

  • CVE-2026-138417 (AX9): stored OS command injection combined with an authentication bypass in the researcher demonstration; public proof of concept, with no fixed version or vendor response in the canonical record.
  • CVE-2026-11405 (several other models): an undocumented alternative authentication path grants administrative access; CERT describes coordination difficulty, while a separate vendor statement confirms affected firmware and says patched releases are public.
  • CVE-2020-10987 (AC15): remote system command execution through the deviceName POST parameter; listed in CISA's Known Exploited Vulnerabilities catalog, added November 3, 2021.

The authentication backdoor case (VU#213560) is instructive. CERT describes an undocumented configuration password checked after normal authentication fails, with a successful match creating an administrative session regardless of username. The original advisory says coordination was unsuccessful and no patch was then available, while Tenda's separate response confirmed affected firmware and public patched releases for discontinued models FH1201, W15E, AC10, AC5, and AC6. That qualifies the original no-patch wording for those products but does not establish an AX9 fix. Neither an older patch nor another model's exploitation history settles the present AX9 status.

References

Detect & fix
what others miss

Works with
  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps Services
  • Gerrit
  • CVS
  • Jira
  • Linear
  • Slack
  • Security Compass
Explore integrations
Security magnifying glass visualization