/

CVE-2026-45558

Severity:

CRITICAL RISK

(9.9)

Config Injection RCE (CWE-94) in Roxy-WI HAProxy Manager

CVE-2026-45558

Deferred

Vulnerability type

Category:

Configuration Injection / Remote Code Execution

CWE:

CWE-20, CWE-77, CWE-78, CWE-94

Impact:

Remote Code Execution on managed HAProxy load balancers

Severity:

CRITICAL RISK

(9.9)

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 configuration injection flaw in Roxy-WI allows unvalidated JSON options to be written verbatim into generated HAProxy configuration files.

Authenticated low-privilege users can inject arbitrary HAProxy directives, including external-check commands, leading to remote code execution on managed load balancers.

Affected context

This vulnerability affects Roxy-WI deployments (version 8.2.6.4 and prior) that use the HAProxy management APIs to generate and push configuration to load balancers.

The issue arises when the HAProxy section-save endpoints accept a JSON option field that is neither validated nor escaped before being rendered into Ansible Jinja2 templates (section.j2, global.j2, and defaults.j2).

Any environment where authenticated users with role ≤ 3 can create or modify HAProxy sections is potentially exposed, especially when Roxy-WI is allowed to reload HAProxy via systemctl reload haproxy on remote servers.

Exploit preconditions

  • Attack surface: Roxy-WI HTTP API endpoints:
  • POST /api/service/haproxy/<server_id>/section/<section_type>
  • PUT /api/service/haproxy/<server_id>/global
  • PUT /api/service/haproxy/<server_id>/defaults
  • Required access: Valid Roxy-WI account with role ≤ 3 (user) and permission to manage at least one HAProxy instance in a group.
  • Trigger point: Submission of crafted JSON payloads containing malicious option values, followed by Roxy-WI's normal workflow that:
  1. Renders configuration via the vulnerable Jinja2 templates.
  2. Pushes the resulting configuration to the HAProxy servers.
  3. Executes systemctl reload haproxy on those servers.
  • Why exploitation is possible: The option field is treated as trusted text and inserted into HAProxy configuration files without validation or escaping.

HAProxy supports directives such as option external-check and external-check command that can execute shell commands, so arbitrary directives in the config can lead to code execution as the haproxy user.

Why this happens

The root cause is improper input validation and output encoding for configuration data that ultimately controls behavior of a privileged service.

Roxy-WI accepts attacker-controlled JSON fields (notably option) and injects them directly into HAProxy configuration templates (section.j2, global.j2, defaults.j2) without:

  • Constraining values to a safe, known set of directives or formats.
  • Sanitizing or escaping characters that alter configuration structure.

This aligns with CWE-20 (Improper Input Validation) and CWE-94 (Improper Control of Generation of Code), because the unvalidated user input influences generated configuration that, in turn, drives execution behavior.

Since HAProxy configuration can define external commands (e.g., via external-check command), the mis-handled configuration effectively becomes an execution vector analogous to command injection (CWE-77/CWE-78) mediated through server configuration.

Potential impact

  • Remote code execution as the haproxy user on all affected load balancers in the compromised group.
  • Execution of arbitrary commands on every health-check tick, enabling persistence and repeated abuse.
  • Unauthorized monitoring, exfiltration, or modification of traffic handled by the HAProxy instances.
  • Pivoting to other internal services reachable from the load balancers.
  • Unauthorized changes to HAProxy routing, health checks, or security-related directives, potentially causing outages or weakening defenses.

General mitigation guidance

Effective mitigation patterns focus on constraining what configuration can be generated and reducing the trust placed in user-supplied fields:

  • Strong schema validation: Treat HAProxy configuration as a structured object model; validate incoming JSON against strict schemas that only allow known-safe directives and argument forms.
  • Whitelisting allowed options: Replace free-form option fields with enumerated, typed configuration controls (e.g., drop-downs, booleans, numeric ranges) that map to allowed HAProxy directives.
  • Output encoding and separation of concerns: Ensure user-provided values are inserted only into safe locations (e.g., as literal strings where HAProxy expects data, not directives) and are properly escaped so they cannot introduce new directives.
  • Least-privilege and control boundaries: Limit which user roles can influence global or defaults sections, and restrict the ability to push and reload configs to a smaller set of trusted administrators.
  • Operational safeguards: Introduce review or approval workflows for configuration changes, including automated sanity checks that reject configs containing dangerous directives such as external command execution.

How teams detect issues like this

Detection can combine code-centric and operational approaches:

  • Static analysis and code review:
  • Flag templating patterns where user-controlled fields are rendered directly into configuration files without validation or escaping.
  • Identify APIs that accept free-form configuration fragments (like option) and verify they are constrained to safe values.
  • Policy-based checks:
  • Implement pre-deployment validation that scans generated HAProxy configs for disallowed directives (e.g., external-check command, execution of shell commands) before pushing them to servers.
  • Enforce CI/CD policies that prevent configuration templates from accepting raw text that can alter control flow.
  • Runtime monitoring:
  • Monitor configuration change events from Roxy-WI and alert on modifications introducing external command execution or other high-risk directives.
  • Track unusual systemctl reload haproxy frequency and inspect associated configuration diffs.
  • Automated tooling:
  • Use configuration linters and security scanners tuned for HAProxy to detect unsafe directives in generated configs as part of a pipeline or scheduled audit.

Sources

SourceLink
github.comgithub.com/roxy-wi/roxy-wi/security/advisories/GHSA-w2x4-66jj-3597

Frequently asked

questions

Exploitation requires an authenticated Roxy-WI account with at least user-level permissions for a group of HAProxy servers.

Within that scope, a single compromised account can influence every load balancer managed by the group.

No direct shell access is required.

The attacker interacts only with the Roxy-WI HTTP API, which then generates and deploys malicious HAProxy configuration that triggers command execution on the load balancers.

Replace free-form, unvalidated configuration fields with structured, schema-validated configuration models, and ensure all user-controlled values are either:

(a) restricted to safe enumerated directives, or

(b) treated purely as data with proper escaping so they cannot introduce new HAProxy directives or commands.

Design configuration UIs and APIs around strongly typed models, implement strict server-side validation and deny-lists/allow-lists for powerful directives, enforce code review focused on templating boundaries, and integrate automated checks that scan generated configs for dangerous execution primitives before deployment.

Find out what's already
exploitable in your codebase.