Summary
A path traversal vulnerability in Roxy-WI's haproxy_section_save interface allows crafted paths to escape intended directories and write into scheduled task locations.
When an attacker can reach this interface over the network, they may be able to plant commands in scheduler-controlled files, leading to remote code execution on the underlying server.
Affected context
This issue affects Roxy-WI deployments where the haproxy_section_save interface is exposed and used to manage HAProxy configuration sections.
The vulnerability is relevant in environments where:
- Roxy-WI is reachable over the network by untrusted or semi-trusted users
- The application can write to filesystem paths that are later executed or processed by scheduled task mechanisms (e.g., cron-like jobs or internal schedulers)
- Path validation and normalization around configuration save operations is incomplete or missing
Exploit preconditions
- Attack surface: HTTP(S) interface of Roxy-WI, specifically requests reaching the haproxy_section_save functionality.
- Required access: Ability to send authenticated or unauthenticated requests (depending on deployment) to the management interface.
- Trigger point: Submission of crafted path parameters or configuration identifiers that cause writes outside the intended configuration directory into scheduler-related paths.
- Why exploitation is possible: The server-side logic does not sufficiently constrain or normalize user-controlled path components, allowing directory traversal (
../) or equivalent tricks that redirect writes into locations processed by scheduled tasks, which then execute attacker-controlled content.
Why this happens
The core issue is improper restriction of a path used for file operations, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
The haproxy_section_save logic appears to trust user-influenced path fragments when determining where to store configuration or section data, without robust normalization and whitelisting.
Because the application is also capable of writing into locations that are later executed or interpreted by scheduled task mechanisms, this directory traversal mistake escalates from a configuration integrity problem into full remote code execution, as attacker-controlled content is eventually run with the scheduler's privileges.
Potential impact
- Remote code execution on the Roxy-WI host via manipulated scheduled tasks
- Unauthorized modification of HAProxy or other managed service configurations
- Disruption of load balancer or proxy availability, potentially leading to denial of service
- Lateral movement within the infrastructure if the compromised host has access to other systems
- Persistence through recurring scheduled tasks that repeatedly execute attacker logic
General mitigation guidance
Effective mitigation usually centers on strong path handling, separation of duties, and hardening of scheduled task execution paths:
- Constrain all file writes in management interfaces to fixed, pre-approved directories using canonical path checks and deny any path containing traversal sequences or symbolic link abuse.
- Use allowlists of configuration file names or identifiers instead of accepting arbitrary file paths from client input.
- Ensure scheduled task mechanisms do not directly execute or interpret files that can be written by web-facing components; separate writable configuration from executable content.
- Run the Roxy-WI process and associated schedulers with least privilege, limiting the directories they can write to or execute from, preferably using OS-level controls (e.g., chroot jails, containerization, filesystem permissions).
- Introduce defense-in-depth controls, such as application-level checks that reject unexpected path patterns and comprehensive logging for all file write operations originating from web requests.
How teams detect issues like this
Detection typically involves a combination of code-centric and operational approaches:
- Static analysis: Search for file write operations that use user-supplied input to construct file paths, especially where
../or dynamic directory components are not explicitly rejected. - Code review: Flag any logic where web parameters determine filenames or directories, and verify canonicalization, normalization, and strict allowlists are present before performing filesystem operations.
- Configuration and policy checks: Enforce internal policies that prohibit web applications from writing directly into directories associated with scheduled tasks, startup scripts, or other executable contexts.
- Runtime monitoring: Observe logs for suspicious save operations, such as attempts to write outside expected configuration directories, and monitor scheduler logs for unexpected task entries or scripts originating from Roxy-WI-related paths.
- Automated SAST/IAST tools can be configured with rules targeting directory traversal patterns and risky file-write sinks to help surface similar issues early in the development lifecycle.

