/

CVE-2026-33208

Severity:

HIGH RISK

(8.8)

OS Command Injection in Roxy-WI find-in-config Endpoint

CVE-2026-33208

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-78

Impact:

Authenticated Remote Code Execution on Managed Servers with Elevated Privileges

Severity:

HIGH RISK

(8.8)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

An OS command injection flaw in Roxy-WI's /config/<service>/find-in-config endpoint allows user-supplied input from the words parameter to be concatenated into a shell command executed on managed servers via SSH.

An authenticated attacker who can access this endpoint may inject shell metacharacters to escape the intended grep context and execute arbitrary OS commands with sudo privileges on the remote server, resulting in full remote code execution.

Affected context

The vulnerability occurs in Roxy-WI deployments where the web interface is used to manage Haproxy, Nginx, Apache, or Keepalived servers, and where configuration searches are performed through the /config/<service>/find-in-config endpoint.

The issue is present when the application builds shell commands that incorporate the words request parameter and forwards them over SSH to run on the managed host, without proper sanitization, quoting, or use of a safe subprocess API.

It becomes risky in environments where Roxy-WI can execute commands with sudo on managed servers, and where authenticated users (including lower-privileged operational accounts) can access this feature.

Exploit preconditions

  • Attack surface: Roxy-WI HTTP(S) interface, specifically the /config/<service>/find-in-config endpoint.
  • Required access: Valid authenticated access with permission to invoke configuration search functionality for a managed service.
  • Reachable target: One or more managed backend servers that Roxy-WI can reach via SSH and on which it is allowed to run commands, often with sudo.
  • Trigger point: Submission of crafted input in the words parameter, causing the server-side code to interpolate it into a shell command (e.g., wrapping it in a grep command) and execute it remotely.
  • Why exploitation is possible: The implementation constructs a shell command string by directly embedding untrusted user input, then executes it through a shell on the remote host, enabling interpretation of shell metacharacters and command chaining.

Why this happens

The root cause is the construction and execution of shell commands that directly embed unvalidated, unescaped user input.

Instead of treating the words parameter as data to be safely passed as an argument, the code builds a single command string (such as a grep invocation) and invokes it via a shell on the managed host.

This maps to CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection'), where control characters and metacharacters are not neutralized, allowing the attacker to alter the command structure.

Conceptually, the insecure pattern is:

  • Accept user input meant to filter or search configuration files.
  • Concatenate that input into a shell-processed command string.
  • Execute the command through SSH with elevated privileges, giving the input direct influence over command execution semantics.

Potential impact

  • Execution of arbitrary OS commands with sudo privileges on managed servers.
  • Complete compromise of affected backend hosts, including installation of malware or backdoors.
  • Unauthorized access to sensitive configuration files, secrets, and application data on managed systems.
  • Lateral movement within the infrastructure using the compromised server as a pivot.
  • Service disruption by modifying or deleting critical configuration files or binaries.
  • Log tampering to obscure evidence of compromise.

General mitigation guidance

Effective mitigation focuses on eliminating direct shell command construction with user input and reducing the privileges of any automation:

  • Avoid shell interpolation: Replace shell-based command construction with parameterized command execution APIs (for example, using subprocess calls that accept argument lists, not shell strings) so user input cannot modify command structure.
  • Strict input handling: Treat search terms and similar parameters as opaque data. Apply allowlist-based validation (e.g., restricting to printable, non-metacharacter text) and enforce reasonable length limits.
  • Context-safe escaping: When shell use cannot be fully avoided, rigorously escape and quote parameters in a way appropriate to the specific shell, and avoid mixing user input into command syntax (pipes, redirections, logical operators).
  • Privilege minimization: Run remote commands under dedicated, least-privileged accounts without sudo access wherever possible, and limit which commands can be executed via sudoers policies.
  • Separation of duties: Isolate configuration search and inspection functions from configuration modification or system-level actions to reduce the blast radius of any input handling flaw.
  • Secure SSH automation: Use tightly scoped SSH keys and server-side controls (e.g., forced commands) to constrain what Roxy-WI is permitted to execute on managed hosts.

How teams detect issues like this

Detection typically combines code-centric and runtime observations:

  • Static analysis patterns:
  • Flag any code paths where HTTP parameters (like words) are concatenated into command strings.
  • Identify uses of shell=True, system(), popen(), or similar APIs that take string commands, especially when combined with user-controlled variables.
  • Highlight places where Roxy-WI constructs SSH command templates that accept untrusted input.
  • Code review signals:
  • Search for endpoints related to configuration search or diagnostics that invoke remote commands.
  • Look for manual string concatenation to build grep or other shell utility commands.
  • Review any use of sudo or privilege escalation for automation tasks triggered from web requests.
  • Policy enforcement:
  • Introduce organizational rules discouraging shell execution from web handlers, or requiring security review before adding such functionality.
  • Integrate SAST tools or linters into CI pipelines to block merges when risky patterns (command injection sinks with tainted input) are detected.
  • Operational monitoring:
  • Monitor managed servers for anomalous commands initiated by the Roxy-WI account, particularly those unrelated to configuration inspection.
  • Collect and analyze SSH logs and sudo logs for unexpected or complex shell constructs originating from Roxy-WI.

Sources

SourceLink
github.comgithub.com/roxy-wi/roxy-wi/commit/02f147d567a3cc8cf61a4b58ea4c2b7866a544de
github.comgithub.com/roxy-wi/roxy-wi/security/advisories/GHSA-7m2h-gmvj-cjx2

Frequently asked

questions

Yes. Any user who can reach the Roxy-WI web interface and authenticate with an account that has access to the vulnerable endpoint can exploit it over HTTP(S), even if they cannot directly access the managed servers themselves.

Not necessarily. The key requirement is authenticated access to the /config/<service>/find-in-config functionality. Even lower-privileged operational accounts can be sufficient if they are allowed to invoke configuration searches that trigger the vulnerable command execution path.

Refactor the implementation to avoid passing user input to a shell. Use APIs that accept argument arrays and treat user-supplied values strictly as data. Combine this with strict input validation and removal of unnecessary sudo or elevated privileges from the remote execution context.

Establish development guidelines that prohibit shell command construction with web-input data, enforce least-privilege execution for automation components, and integrate security-focused code review and static analysis rules that specifically flag command injection patterns whenever untrusted input flows into command execution APIs.

Find out what's already
exploitable in your codebase.