Summary
A command injection weakness in the GL.iNet Wi-Fi Timer Power-Schedule feature may allow remote attackers to influence operating-system commands through manipulated power-scheduling arguments. The risk arises when user-controlled values supplied to switch_power or restore_power are passed to a command interpreter without sufficiently strict validation or safe execution.
Affected context
The issue affects GL.iNet router models using the Wi-Fi Timer Power-Schedule feature in releases up to the stated 4.8.x range. It becomes relevant where remotely reachable feature handlers process the switch_power or restore_power arguments and incorporate their values into operating-system command execution. Actual exposure depends on device configuration, network reachability, authentication controls, and the feature's enabled state.
Exploit preconditions
- Attack surface: The remotely reachable Wi-Fi Timer Power-Schedule feature
- Required access: Network access to the affected device and any access
permitted by its management or feature-level controls
- Trigger point: Processing of the
switch_powerorrestore_power
argument
- Why exploitation is possible: Input may reach an operating-system
command execution path without adequate separation between data and command
syntax
Why this happens
The underlying bug is an OS command injection condition, mapped primarily to CWE-78. The affected functionality appears to treat a request argument as part of a shell or system command rather than as strictly bounded data. CWE-77 is also relevant because the weakness involves improper neutralization of special elements used to construct or invoke commands. The insecure pattern is the concatenation or unsafe interpolation of externally influenced values into command execution APIs.
Potential impact
- An attacker may execute commands with the privileges of the affected service
- Device configuration, routing, or wireless settings could be altered
- Sensitive information stored on the router could be accessed
- The device could be used for persistence, traffic interception, or abuse
- Compromised routers could support lateral movement into reachable networks
General mitigation guidance
Mitigation generally focuses on removing shell interpretation from the
power-scheduling workflow and reducing trust in request parameters.
Common defensive patterns include:
- Use direct process or system APIs that pass arguments separately rather
than invoking a shell
- Apply strict allowlists for accepted power-schedule operations and values
- Validate input types, ranges, and expected formats before any system call
- Avoid constructing commands through string concatenation or interpolation
- Run the feature under the minimum operating-system privileges required
- Restrict remote management exposure and require strong authentication
- Log rejected inputs and unusual scheduling requests for investigation
How teams detect issues like this
Organizations can look for command injection risks through:
- Static analysis rules identifying shell invocation APIs and string-built
commands
- Code review searches for request parameters passed to process execution,
shell wrappers, or scripting interfaces
- Tests using boundary values and unexpected command syntax to verify that
inputs remain data
- Runtime monitoring for anomalous process creation by the router service
- Policy enforcement requiring allowlisted command arguments and prohibiting
shell execution for network-controlled inputs
- Automated security review tools that flag CWE-77 and CWE-78 patterns

