Summary
Finsys Dockhand has a path traversal vulnerability in its stack relocation endpoint: a user with stacks:edit permission can provide an unvalidated source path. This may let them move arbitrary server directories into stack paths, potentially disrupting services or exposing directory contents.
Affected context
The issue concerns Finsys Dockhand's stack relocation functionality at POST /api/stacks/[name]/relocate. It is present where the endpoint accepts a caller-supplied oldDir value without adequately constraining it to permitted source directories. The description identifies Finsys Dockhand versions before 1.0.55 as affected.
Exploit preconditions
- Attack surface: The stack relocation API endpoint
- Required access: A user account with
stacks:editpermission - Trigger point: Processing a relocation request containing a crafted
oldDirvalue - Why exploitation is possible: The source path is not adequately validated or restricted, allowing paths outside the intended stack directory scope to be used.
Why this happens
The application uses a caller-controlled path to select a directory for relocation without sufficiently constraining that path to an authorized filesystem location. This is an external control of file name or path, corresponding to CWE-73. The underlying insecure pattern is trusting user-supplied path information without enforcing an intended directory boundary.
Potential impact
- An attacker with the required permission may move directories outside the intended stack scope.
- Services relying on affected directories could be disrupted.
- Contents of relocated directories could become exposed through stack paths or application behavior.
- Directory changes could complicate recovery and incident investigation.
General mitigation guidance
Mitigations generally focus on ensuring relocation operations can only act on explicitly authorized locations.
- Resolve and canonicalize paths, then verify they remain within an approved base directory.
- Prefer server-side identifiers or allowlisted directory mappings over accepting arbitrary paths.
- Validate source and destination paths before performing filesystem operations.
- Apply least-privilege filesystem permissions to the service account and limit who receives
stacks:editpermission. - Use secure-by-default behavior that rejects ambiguous, unexpected, or out-of-scope paths.
How teams detect issues like this
- Use static analysis to identify filesystem operations that consume request parameters or other untrusted path values.
- Review relocation and file-management code for missing canonicalization, base-directory checks, or allowlists.
- Monitor API and application logs for relocation requests involving paths outside expected stack locations or repeated rejected path values.
- Enforce code-review and CI policies requiring path-boundary validation for filesystem operations.

