Summary
An unauthenticated path traversal issue in Runtipi's UserConfigController allows arbitrary file writes, including overwriting the primary docker-compose.yml configuration.
By abusing insecure URN parsing, a remote attacker can replace the main stack configuration so that on the next restart, malicious containers are launched, leading to remote code execution and potential host filesystem compromise.
Affected context
This vulnerability affects Runtipi personal homeserver deployments that expose the UserConfigController over a network where unauthenticated users can reach it.
The issue is present when:
- The application accepts URN- or path-like user input to identify configuration files
- That input is used to resolve filesystem paths without robust normalization and enforcement of allowed directories
- The resulting path can reach the main
docker-compose.ymlor other sensitive configuration files used to orchestrate containers
The risk materializes when the operator later restarts or redeploys the stack, causing the compromised configuration to be executed.
Exploit preconditions
- Attack surface: HTTP/API interface exposed by Runtipi's
UserConfigController. - Required access: None; the vulnerable endpoint is reachable without authentication.
- Trigger point: Submission of a crafted URN/path parameter that traverses out of the intended directory and targets
docker-compose.yml(or other critical files). - Why exploitation is possible: User input intended to reference configuration resources is parsed and mapped to filesystem paths without strong directory confinement, canonicalization checks, or authentication/authorization, enabling an attacker to overwrite protected configuration files.
Why this happens
The root cause is insufficient path validation when resolving URN-like input into filesystem locations, combined with a lack of authentication on a sensitive configuration-management endpoint.
This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path segments (such as ../) are not normalized and constrained to an allowed base directory.
Additionally, the missing or inadequate authentication on the configuration controller corresponds to CWE-306: Missing Authentication for Critical Function, because the ability to modify core orchestration configuration is exposed to unauthenticated users.
In abstract terms, the system trusts user-provided identifiers to directly influence which files are written, instead of treating them as untrusted input that must be tightly constrained and mediated.
Potential impact
- Overwriting of
docker-compose.ymlwith attacker-controlled content - Remote Code Execution when the operator restarts or redeploys the Runtipi stack
- Deployment of malicious containers that can exfiltrate data or pivot further into the host
- Compromise of host filesystem via privileged or bind-mounted containers defined in the attacker's configuration
- Persistent backdoors embedded into the orchestration configuration
General mitigation guidance
Effective mitigation focuses on strictly constraining how user input maps to filesystem operations and protecting configuration management endpoints:
- Enforce robust authentication and, where appropriate, authorization checks on any feature that reads, writes, or replaces configuration files.
- Implement strict path canonicalization and validation: resolve input to an absolute path, verify it remains under a predefined configuration directory, and reject any attempt to escape that boundary.
- Use allowlists of known configuration file names or IDs instead of accepting arbitrary paths or URNs from clients.
- Separate user-editable configuration from core orchestration files; keep critical files write-protected by the application and editable only through controlled, privileged workflows.
- Run the service under least-privilege OS accounts and file permissions so that even if a write operation is misused, the attacker's access to sensitive files is minimized.
How teams detect issues like this
Teams can pursue a mix of static and operational detection strategies:
- Static analysis and code review: Flag any code paths where user-supplied strings are concatenated into file paths, especially in controllers handling configuration; verify canonicalization and directory constraints are applied consistently.
- Policy enforcement: Establish coding standards requiring safe file-access wrappers that automatically enforce base-directory checks and disallow relative traversal sequences.
- Runtime monitoring: Inspect application and web server logs for suspicious configuration operations, such as unexpected writes to
docker-compose.ymlor other core files, and requests containing traversal patterns in URN or path parameters. - File integrity monitoring: Track changes to critical configuration files (e.g.,
docker-compose.yml) and alert on modifications originating from the application runtime rather than authorized administrative workflows.

