Summary
An unauthenticated path traversal vulnerability in Windmill's get_log_file endpoint allows attackers to manipulate the filename parameter to traverse directories on the server.
By injecting ../ sequences, an attacker can read arbitrary files that the Windmill server process can access, exposing sensitive configuration, credentials, or application data.
Affected context
This vulnerability affects Windmill deployments where the get_log_file endpoint (/api/w/{workspace}/jobs_u/get_log_file/{filename}) is exposed and reachable, typically in production or staging environments.
The issue arises when the server constructs a filesystem path from the unvalidated filename parameter and serves the requested file as a job log.
Any deployment where this endpoint is accessible without strong upstream filtering or isolation may be at risk, especially when the Windmill process has access to sensitive files on the host.
Exploit preconditions
- Attack surface: HTTP(S) interface, specifically the
get_log_fileAPI endpoint. - Required access: No authentication required; any network client that can reach the endpoint can attempt exploitation.
- Trigger point: Supplying a crafted
filenamepath segment containing directory traversal sequences (e.g.,../) to navigate outside the intended log directory. - Why exploitation is possible: The server concatenates the user-controlled
filenamedirectly into a filesystem path without normalization, canonicalization, or restriction to an allowed directory, enabling traversal to arbitrary readable locations.
Why this happens
The core issue is improper neutralization of path elements when constructing filesystem paths from user input, aligning with CWE-22: Improper Limitation of a Pathname to a Restricted Directory.
Instead of strictly confining access to a designated log directory, the implementation appears to join the filename parameter directly into the path, trusting that it references only a log file.
Without canonicalization and validation (e.g., enforcing that the resolved path remains under a specific base directory), directory traversal sequences like ../ allow access to files outside the intended scope.
This pattern reflects a broader bug class where file operations are performed on paths derived from untrusted input without adequate constraint or normalization.
Potential impact
- Unauthorized reading of application configuration files that may contain secrets or API keys.
- Exposure of environment-specific secrets such as database credentials, tokens, or cryptographic keys.
- Disclosure of system files that reveal OS details, user accounts, or service configurations.
- Access to other application logs that may include sensitive user data or internal error traces.
- Collection of information that can facilitate further attacks, such as privilege escalation or lateral movement.
General mitigation guidance
Effective mitigation focuses on constraining file access to a tightly controlled directory and minimizing trust in user-supplied path components.
Recommended defensive patterns include:
- Avoid constructing filesystem paths via simple string concatenation; instead, join paths using standard utilities and canonicalize the result.
- Enforce a strict allowlist of files or patterns when serving logs (e.g., mapping logical identifiers to known log filenames rather than accepting raw paths).
- After resolving a path, verify that it remains within a predefined base directory (e.g., compare canonical paths or use chroot-like directory scoping).
- Separate sensitive configuration and secret storage from application-readable log directories where feasible.
- Run the Windmill service with least-privilege file system permissions so that even if path traversal occurs, the process cannot read highly sensitive system or secret files.
How teams detect issues like this
Detection of similar vulnerabilities is typically done through a combination of static and dynamic techniques:
- Static analysis: Scan code for patterns where request parameters or route segments are used directly in file operations (
open,read, or framework file-serving utilities) without validation or canonicalization. - Code review: Flag endpoints that expose file reading or download behavior; reviewers should verify strict base-directory enforcement and the absence of
../-sensitive joins. - Security testing: Use automated or manual HTTP testing to attempt directory traversal sequences on any file-serving endpoints, confirming that requests outside the intended directory are rejected.
- Runtime monitoring: Configure logs or WAF rules to detect requests containing traversal patterns (e.g.,
../,%2e%2e/) and alert or block when such patterns appear.

