Summary
Dockhand has a path traversal flaw in file handling that can let authenticated users with stacks:edit access files outside the intended browser directory. By combining symlinks with .. path segments, an attacker may read sensitive files or move them through the stack relocation endpoint, potentially exposing stored credentials.
Affected context
The issue affects Dockhand file operations where a path guard can be bypassed using symlinks and .. sequences. The described exposure involves /api/system/files/content and the stack relocation endpoint; exploitation requires an authenticated user with stacks:edit access.
Exploit preconditions
- Attack surface: Dockhand file-content and stack-relocation API endpoints
- Required access: An authenticated account with
stacks:edit - Trigger point: A file operation that processes a path containing symlinks and
..sequences - Why exploitation is possible: The path guard can be bypassed, allowing file operations to reach paths outside the intended directory
Why this happens
The underlying issue is insufficient path containment enforcement, mapping to CWE-22: Improper Limitation of a Pathname to a Restricted Directory. A guard that checks path strings without reliably accounting for symlink resolution can treat a path as confined even when its resolved destination lies outside the permitted directory.
Potential impact
- Attackers may read
/proc/self/environ, the SQLite database, or the encryption key. - Stored credentials may be exposed if sensitive files are accessed.
- Sensitive files could be moved through the stack relocation functionality.
- Disclosure of application secrets could enable further compromise, depending on deployment and credential reuse.
General mitigation guidance
Defensive approaches focus on enforcing directory boundaries after resolving paths and on limiting the effects of file operations.
- Resolve and canonicalize paths before access, then verify that the resolved target remains within the permitted root.
- Apply consistent containment checks to both file reads and relocation operations.
- Restrict or reject symlinks where they are not needed, and avoid trusting user-controlled path components.
- Limit access to file-management capabilities and run the application with only the filesystem permissions it requires.
How teams detect issues like this
- Review file APIs for path checks performed on uncanonicalized strings or checks that do not account for symlinks.
- Use static analysis to flag filesystem operations involving user-controlled paths without containment validation.
- Test that path resolution and relocation remain confined to approved roots, including when symlinks are present.
- Monitor access to sensitive files and unexpected file moves, and enforce policies that limit which identities can use file-management endpoints.

