Summary
openNDS uses the client_params.sh script to generate the authenticated client status page, but crafted HTTP query parameter names can be interpreted as shell input. An authenticated captive portal user may exploit this behavior to execute arbitrary operating system commands with the privileges of the openNDS process.
Affected context
The vulnerability occurs in openNDS deployments that use the client_params.sh script when serving the authenticated client status page. It becomes risky when attacker-controlled HTTP query parameter names are passed into shell-processing logic without sufficiently separating data from command syntax.
Exploit preconditions
- Attack surface: The authenticated captive portal status-page HTTP endpoint
- Required access: An authenticated captive portal user account or session
- Trigger point: Processing of crafted query parameter names during status-page generation
- Why exploitation is possible: Shell metacharacters in attacker-controlled parameter keys may be interpreted as command syntax by the script
Why this happens
The underlying bug is OS command injection caused by treating untrusted HTTP parameter names as shell-interpretable content. When input is incorporated into shell commands without strict separation, validation, or safe argument handling, command syntax can escape the intended data context. This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command, commonly known as OS command injection.
Potential impact
- An attacker may execute arbitrary commands with the privileges of the openNDS process.
- The captive portal host could be compromised.
- Network configuration or portal behavior could be altered.
- Sensitive local data may be accessed or modified.
- The compromised service could be used to attack adjacent network resources.
General mitigation guidance
Mitigation generally focuses on ensuring that HTTP parameter names and values remain data throughout request processing.
Common defensive patterns include:
- Avoiding shell evaluation when handling web request data.
- Using direct process or library APIs with explicit argument arrays instead of command strings.
- Applying strict allowlists for accepted parameter names and formats.
- Separating authentication, input validation, and response-generation logic.
- Running the captive portal service with the minimum privileges and filesystem access required.
- Restricting access to administrative, host-level, and network-management capabilities from the service account.
- Treating authenticated users as untrusted for command execution and configuration purposes.
How teams detect issues like this
Organizations can look for this weakness through:
- Static analysis rules identifying shell command construction from HTTP parameter names or values.
- Code review checks for shell evaluation, command substitution, or unquoted request-derived variables.
- Tests that submit metacharacters in both parameter names and values and verify that they remain inert.
- Web-server and application logs showing unusual query keys, shell metacharacters, or unexpected child-process creation.
- Runtime policies that alert when the captive portal process starts shells or executes commands outside an approved set.
Automated security review tools may help identify dangerous data flows from request parsing into shell execution.

