/

CVE-2026-27811

Severity:

HIGH RISK

(8.8)

OS Command Injection in Roxy-WI Configuration Compare

CVE-2026-27811

Analyzed

Vulnerability type

Category:

OS Command Injection

CWE:

CWE-77, CWE-78

Impact:

Authenticated Remote Code Execution on Application Host

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

A command injection vulnerability in Roxy-WI's configuration comparison endpoint allows authenticated users to inject arbitrary system commands into a template string that is later executed on the application host.

When attacker-controlled parameters are embedded directly into shell command templates, an authenticated user can pivot from web access to full command execution on the underlying server.

Affected context

This vulnerability affects Roxy-WI deployments that expose the /config/compare/<service>/<server_ip>/show endpoint to authenticated users.

The issue arises when user-supplied values for service and/or server_ip are interpolated directly into a command template in app/modules/config/config.py (around line 362), which is subsequently executed, likely via a shell.

Environments where Roxy-WI runs with high system privileges (e.g., root or broad sudo access) are at increased risk because successful exploitation translates directly into powerful system-level control.

Exploit preconditions

  • Attack surface: HTTP(S) interface of the Roxy-WI application, specifically the /config/compare/<service>/<server_ip>/show route.
  • Required access: Valid authenticated access to Roxy-WI with the ability to reach the configuration comparison feature.
  • Trigger point: Submission of crafted values in the path or parameters that are incorporated into the command template used for configuration comparison.
  • Why exploitation is possible: User input is directly formatted into a template string that is used to build a shell command without proper escaping, validation, or use of a safe execution API, enabling injection of additional shell metacharacters and commands.

Why this happens

The underlying bug stems from constructing shell commands by concatenating or interpolating untrusted input into a command string that is later executed by the system.

This design matches CWE-78: Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection') and is closely related to CWE-77: Improper Neutralization of Special Elements used in a Command ('Command Injection').

Instead of treating user input as opaque data passed to a parameterized execution API, the code builds a shell command line where user-controlled segments can introduce shell metacharacters, pipelines, or additional arguments.

Because the shell interprets these special characters, an attacker can escape the intended command context and execute arbitrary OS-level commands.

Potential impact

  • Execution of arbitrary system commands under the privileges of the Roxy-WI process.
  • Unauthorized access to sensitive configuration files and stored secrets on the host.
  • Lateral movement to other services or infrastructure managed by Roxy-WI.
  • Installation of backdoors, web shells, or other persistent malware on the host.
  • Interference with HAProxy, Nginx, Apache, or Keepalived configurations, potentially causing outages or traffic hijacking.
  • Use of the compromised server as a pivot point for broader network compromise.

General mitigation guidance

Effective mitigation focuses on eliminating direct shell command construction from untrusted input and hardening the execution model:

  • Avoid shell invocation where possible: Prefer native language APIs or libraries (e.g., filesystem operations, diff libraries, configuration parsers) instead of calling external tools via the shell.
  • Use parameterized execution: When external commands are unavoidable, use APIs that accept argument arrays (e.g., execve-style calls, subprocess with shell=False), ensuring user input is treated purely as data.
  • Strict input validation: Constrain service, server_ip, and similar parameters to well-defined formats (whitelists of known services, IP/hostname validation) and reject any unexpected characters.
  • Escape and encode cautiously: If shell usage is absolutely required, apply robust escaping mechanisms tailored to the target shell, while still combining this with strong validation and least privilege.
  • Least-privilege execution: Run the Roxy-WI process under a dedicated, low-privilege account with minimal file system and network permissions to limit the blast radius in case of exploitation.
  • Defense in depth: Use network segmentation, application-layer access controls, and logging/monitoring to detect and contain abnormal command execution behavior.

How teams detect issues like this

Identifying and preventing similar vulnerabilities can be approached through code-centric and operational measures:

  • Static analysis: Configure SAST rules to flag:
  • Use of shell-invoking APIs (system, popen, subprocess with shell=True, etc.) with string concatenation or formatting that includes variables derived from HTTP requests or user inputs.
  • Direct integration of URL path components or query parameters into command strings.
  • Code review patterns: During manual review, scrutinize any code that:
  • Constructs command lines using f-strings, format, or string concatenation.
  • Uses unfiltered request-derived values (service, server_ip, etc.) in OS-level operations.
  • Relies on shell features (pipes, redirection) instead of safer, library-based alternatives.
  • Centralized security policies: Establish development guidelines that discourage shell command usage and mandate safe execution patterns, enforced via linters or pre-commit hooks.
  • Runtime monitoring: Implement logging and monitoring of command execution events (e.g., process creation logs) and watch for unusual commands triggered by web requests or by the Roxy-WI process.
  • Automated testing: Incorporate security-focused tests or fuzzing around routes that perform configuration comparisons or environment introspection to catch injection vectors.

Sources

SourceLink
github.comgithub.com/roxy-wi/roxy-wi/commit/a10ac7306c252014f97a7213db4a9470300fa064
github.comgithub.com/roxy-wi/roxy-wi/releases/tag/v8.2.6.3
github.comgithub.com/roxy-wi/roxy-wi/security/advisories/GHSA-jvmv-cw47-jh77

Frequently asked

questions

Exploitation is limited to users who can authenticate to Roxy-WI and access the affected configuration comparison functionality. Within that scope, however, a successful attacker can typically execute arbitrary commands on the application host.

No additional system-level privileges are required beyond authenticated access to Roxy-WI. The commands run with the privileges of the Roxy-WI process, which may be substantial if the service is misconfigured to run as a high-privilege user.

The safest pattern is to remove shell-based command construction entirely and replace it with library calls that perform the necessary comparison or retrieval logic. If external tools must be used, call them via parameterized APIs that never concatenate untrusted input into a shell command line.

Adopt a development policy that treats all user input as untrusted, bans direct use of shells for routine operations, and mandates strict validation for any user-controllable parameters involved in system interactions. Combine this with automated static analysis, security-focused code review, and least-privilege runtime configurations to reduce the likelihood and impact of command injection flaws.

Find out what's already
exploitable in your codebase.