Summary
A logic error in Roxy-WI's path validation allows directory traversal payloads such as ../../etc/passwd to bypass checks for unsafe sequences in configuration file parameters.
When an attacker can influence config_file_name or configver, they may read or manipulate files outside the intended directories despite an apparent security check.
Affected context
This vulnerability affects Roxy-WI deployments where user-supplied values for configuration-related parameters (such as config_file_name and configver) are accepted and passed through the flawed validation logic in app/modules/config/config.py.
It becomes relevant in contexts where these parameters can be set directly or indirectly via HTTP requests, UI fields, or API calls that are not otherwise filtered or constrained to safe paths.
The issue is more impactful when the Roxy-WI process has access to sensitive system files or critical service configuration directories.
Exploit preconditions
- Attack surface: HTTP(s) interface of the Roxy-WI application, including any routes that accept configuration file names or versions.
- Required access: Ability to submit or control values for
config_file_name,configver, or similar parameters (e.g., authenticated user with configuration management permissions). - Trigger point: The server-side logic that constructs filesystem paths from these parameters and relies on the incorrect tuple-membership check to block
..sequences. - Why exploitation is possible: The code uses a tuple-membership expression like
'..' in (a, b, c)that only catches exact matches, not substrings. Realistic traversal payloads containing..within longer strings bypass the check, allowing relative path components to traverse out of the intended base directory.
Why this happens
The root cause is a misuse of language constructs for input validation, mapping to CWE-22 (Improper Limitation of a Pathname to a Restricted Directory) and CWE-697 (Incorrect Comparison).
Instead of checking whether the substring '..' appears within user-controlled path components, the code checks membership of the exact string '..' within a tuple of values, which returns true only when a value is exactly '..'.
This logic flaw creates a false sense of protection: the validation appears present but does not constrain relative path elements embedded in realistic traversal payloads.
As a result, attackers can supply paths like ../../etc/passwd or ..\\..\\sensitive\\config that pass the check and are subsequently used in filesystem operations.
Potential impact
- May allow reading of sensitive files (e.g., system configuration, application secrets) that are readable by the Roxy-WI process.
- Could enable overwriting or tampering with configuration files for HAProxy, Nginx, Apache, Keepalived, or other managed services.
- Can expose credentials, keys, or tokens stored in configuration or auxiliary files.
- Might facilitate further privilege escalation or lateral movement if critical service configurations or scripts are modified.
- Can undermine integrity and availability of load-balancing or proxy infrastructure by altering or deleting configurations.
General mitigation guidance
Effective mitigation focuses on robust path handling, validation, and privilege reduction rather than individual string checks.
General defensive patterns include:
- Constraining all user-supplied file references to specific, predefined base directories and rejecting any paths that resolve outside them after normalization.
- Using path normalization utilities to canonicalize paths, then enforcing allowlists of known-safe directories or filenames.
- Validating configuration identifiers as opaque tokens (IDs, slugs) rather than direct filesystem paths, and mapping them to server-side locations.
- Avoiding ad-hoc string checks for
..and instead adopting consistent, centralized path validation helpers that are reused throughout the codebase. - Running the Roxy-WI service with least-privilege filesystem permissions so that even if a traversal occurs, access to sensitive system paths is limited.
- Separating configuration directories for the management UI from core system configuration to reduce blast radius.
How teams detect issues like this
Detection can combine code-level analysis with runtime monitoring:
- Static analysis: Configure rules to detect:
- Direct concatenation of user-controlled input into filesystem paths.
- Ineffective or incorrect comparison patterns (e.g.,
'..' in (a, b, c)instead of substring or normalized path checks). - Lack of canonicalization before using paths with open/read/write operations.
- Code review signals: During manual review, flag:
- Any use of path parameters that originate from HTTP requests or UI fields.
- Ad-hoc checks for traversal indicators (
..,../,..\) that do not account for all encodings or rely on simple equality/membership rather than normalized path inspection. - Duplicate or scattered validation logic rather than a single hardened path-validation utility.
- Runtime monitoring:
- Log all configuration file access paths and alert on unexpected directories or patterns like
../. - Use web application firewalls or reverse proxies to inspect requests for traversal patterns and block suspicious payloads where feasible.
Automated SAST and security-focused linters can assist by flagging insecure path handling patterns as part of CI pipelines.

