Summary
Shenzhen Aitemi M300 Wi-Fi Repeater (MT02) exposes an unauthenticated OS command injection flaw in its commuos web backend.
Network-adjacent attackers can craft malicious HTTP GET parameters that are embedded into shell commands, enabling arbitrary code execution with root privileges on the device.
Affected context
This vulnerability manifests in the embedded web management interface of the Aitemi M300 Wi-Fi Repeater.
It is relevant when the device's commuos backend is reachable over the local network (e.g., LAN or Wi-Fi) and processes requests to the smacfilter_conf handler.
In typical deployments, the interface is exposed to users on the same network segment, and the absence of authentication or robust input validation allows crafted parameters to flow into shell commands.
Exploit preconditions
- Attack surface: HTTP interface of the commuos web backend, specifically the
smacfilter_confhandler. - Required access: Network-adjacent access (same LAN/Wi-Fi segment) to send HTTP GET requests to the device; no authentication required.
- Trigger point: Submission of crafted
name,enable, ormacGET parameters containing semicolon-delimited command payloads. - Why exploitation is possible: User-controlled values are concatenated via
sprintf()into UCI-related shell command strings and executed bydoSystemCmdComlib()without sanitization or escaping, allowing command chaining.
Why this happens
The core bug is direct inclusion of untrusted input into shell command strings, followed by execution via a system command wrapper.
By using sprintf() to build UCI shell commands from the name, enable, and mac GET parameters and then passing those commands into doSystemCmdComlib(), the backend treats user data as part of the shell syntax.
This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where meta-characters such as semicolons are not neutralized, enabling attackers to append arbitrary commands.
Potential impact
- Attackers may execute arbitrary shell commands with root privileges on the repeater.
- Device configuration could be altered, reset, or permanently corrupted.
- The repeater could be converted into a pivot point for further attacks on the local network.
- Malware or botnet agents could be installed on the device.
- Sensitive network information (e.g., Wi-Fi credentials, internal IP mappings) could be exposed.
General mitigation guidance
Effective mitigation focuses on eliminating direct command construction from user input and reducing the device's exposure.
Common patterns include:
- Replacing shell-based command execution with parameterized system APIs or libraries that avoid invoking the shell.
- Strictly validating and whitelisting inputs for configuration fields (e.g., MAC addresses and names) before processing.
- Neutralizing or rejecting shell metacharacters and enforcing predictable formats for all web parameters.
- Running device services with least privilege where possible and separating configuration logic from execution paths.
- Limiting external management exposure (for example, by restricting access to trusted network segments and disabling remote administration when not needed).
How teams detect issues like this
Detection often relies on reviewing how command execution is implemented and monitored:
- Static analysis rules can flag use of command execution wrappers (e.g.,
system,popen, or custom helpers likedoSystemCmdComlib()) that concatenate user-controlled data. - Code reviews should look for
sprintf()or similar string-building functions that incorporate HTTP parameters into OS-level commands. - Security testing (including fuzzing and dynamic analysis) can attempt to inject command separators and observe unexpected behavior.
- Policy-based enforcement in firmware development pipelines can require that any command execution path pass through input validation and escaping routines, with automated checks to detect violations.

