Summary
Roxy-WI contains a path traversal vulnerability in the haproxy_section_save interface where the oldconfig parameter can be abused to read arbitrary files from the server filesystem.
An attacker who can interact with this interface may be able to access sensitive configuration or system files, depending on the web server's permissions and deployment setup.
Affected context
The issue arises in Roxy-WI deployments that expose the haproxy_section_save endpoint and accept the oldconfig parameter with insufficient path validation.
It typically manifests when user-supplied paths or filenames are used to locate HAProxy configuration data on disk and are concatenated or interpolated into filesystem operations without enforcing a strict, canonical base directory.
The risk is higher when the Roxy-WI process runs with privileges that allow reading system or application configuration files beyond the intended HAProxy configuration path.
Exploit preconditions
- Attack surface: HTTP(S) interface of Roxy-WI, specifically the
haproxy_section_saveendpoint. - Required access: Ability to send crafted requests to the management interface (often authenticated, depending on deployment and access controls).
- Trigger point: Supplying a malicious value for the
oldconfigparameter that includes path traversal sequences or unintended file paths. - Why exploitation is possible: The server-side code uses the
oldconfigparameter to construct file paths without robust normalization, canonicalization, or restriction to a fixed directory, enabling traversal outside the intended configuration directory.
Why this happens
The vulnerability stems from improper neutralization of path input used in file operations, mapping directly to CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
In the affected Roxy-WI code path, the oldconfig parameter is treated as a trusted indicator of which configuration file to access, and the value is likely concatenated with a base path or used directly in filesystem APIs.
Without enforcing that the resulting resolved path stays within an approved directory, attackers can introduce ../ sequences or absolute paths, causing the application to read arbitrary files that are accessible to the Roxy-WI process.
Potential impact
- Disclosure of HAProxy, Nginx, Apache, or Keepalived configuration files containing internal network details, credentials, or keys.
- Exposure of system files such as
/etc/passwd, logs, or application secrets that may aid in further attacks. - Leakage of TLS private keys or sensitive tokens if stored in readable locations.
- Facilitation of privilege escalation or lateral movement by providing reconnaissance data to an attacker.
General mitigation guidance
Effective mitigations focus on strictly controlling how file paths are derived from user input and limiting what the process can read:
- Enforce a strict allowlist of configuration filenames or identifiers instead of accepting raw path segments from clients.
- Resolve and canonicalize any file path derived from user input, then verify that it remains inside a designated configuration directory before use.
- Use high-level abstractions that decouple external identifiers (IDs or names) from actual filesystem paths, rather than passing paths across trust boundaries.
- Run the Roxy-WI service under an account with minimum necessary filesystem privileges and avoid storing sensitive secrets in locations readable by the service unless absolutely required.
- Apply defense-in-depth constraints (e.g., container filesystem restrictions, AppArmor/SELinux profiles) to limit which files the process can access regardless of input.
How teams detect issues like this
Detection generally combines code-centric and operational approaches:
- Use static analysis rules to flag joins or concatenations of request parameters (like
oldconfig) with filesystem paths, especially when combined with open/read operations. - During code review, scrutinize all endpoints that handle file names or paths, verifying canonicalization, directory checks, and deny-by-default behavior.
- Implement logging around configuration file access paths and monitor for suspicious patterns, such as
../sequences or access attempts outside expected directories. - Integrate automated security scanning tools in CI pipelines that can detect path traversal patterns in web handlers and configuration management modules.

