Summary
RaspAP raspap-webgui versions prior to 3.3.6 contain an OS command injection vulnerability that allows user-supplied input to be executed as part of system commands.
An authenticated user who can log in to the web interface may be able to run arbitrary commands on the underlying operating system, depending on how the application invokes system utilities.
Affected context
This vulnerability exists in RaspAP raspap-webgui in environments where the web interface invokes operating system utilities (such as networking or system management commands) using user-controllable parameters.
It becomes relevant when:
- Users can authenticate and access configuration or management functions, and
- The server-side logic concatenates or interpolates user input into shell commands without proper neutralization or strict parameterization.
The issue is limited to deployments where the web server process has the ability to spawn system commands and where authentication is enabled and accessible.
Exploit preconditions
- Attack surface: Web management interface of RaspAP raspap-webgui
- Required access: Valid user account or otherwise authenticated access to the affected functionality
- Trigger point: Submission of crafted input into fields or endpoints that are used to build and execute OS-level commands
- Why exploitation is possible: Application logic constructs shell commands by embedding untrusted, authenticated user input without sufficient sanitization, escaping, or separation between data and command context, enabling command injection.
Why this happens
The core issue is a classic command injection pattern where application code builds shell commands by concatenating strings that include user-supplied values.
When these values are not strictly validated, escaped, or mapped to a fixed set of allowed tokens, the shell interprets special characters, operators, or additional command fragments as part of the command line.
This aligns with CWE-78: Improper Neutralization of Special Elements used in an OS Command, where untrusted input is passed directly into command interpreters, allowing attackers to break out of the intended command structure.
Potential impact
- Execution of arbitrary OS commands with the privileges of the web server or application user
- Reading or modifying sensitive configuration files on the host system
- Installing or running additional tools or malware on the device
- Disrupting network connectivity or system availability by altering system services
- Using the compromised device as a pivot point for further attacks in the local network
General mitigation guidance
Effective mitigation focuses on isolating user input from command execution and reducing the privileges of the executing context:
- Replace shell invocation with direct API or library calls for system and networking operations, avoiding command-line construction entirely where possible.
- When command execution is unavoidable, use parameterized process execution APIs that pass arguments as arrays instead of concatenated strings, and disable shell features.
- Enforce strict allowlists for expected input values (e.g., predefined options, numeric ranges, or known interface names) and reject or normalize anything outside those constraints.
- Apply robust input validation and encoding before using user data in any system-level operation, treating all authenticated input as untrusted.
- Run the web server and associated processes with least-privilege accounts and restrict access to sensitive files and commands to limit blast radius.
How teams detect issues like this
Organizations can look for this class of vulnerability through multiple complementary approaches:
- Static analysis: Configure rules to flag uses of shell execution functions (e.g.,
system,exec,popen, backticks) where arguments include variables derived from HTTP request parameters or other user input. - Code review: Pay attention to any code paths that construct command strings, especially around network, wireless, or system administration features exposed in the UI; verify that only safe, validated values flow into these commands.
- Dynamic testing: Use web application security testing tools or manual testing to inject command separators and shell metacharacters into relevant parameters and observe whether unexpected command behavior occurs.
- Runtime monitoring: Enable logging of command invocations and anomalous process activity on the device; alert on unusual commands executed by the web server process.

