Summary
Dokploy contains a path traversal vulnerability in repository file reads that can allow authenticated organization members with service read permission to access files outside the intended repository path. Depending on the server handling the request, this could expose sensitive files on the Dokploy host or managed remote servers.
Affected context
The issue occurs in Dokploy's patch.readRepoFile functionality when a supplied filePath is used to locate a repository file. It becomes risky when path components are not adequately constrained to the intended repository directory and a requester has the required service read permission.
Exploit preconditions
- Attack surface: The repository file-reading functionality in Dokploy
- Required access: Authentication as an organization member with service read permission
- Trigger point: A request to
patch.readRepoFilecontaining afilePath - Why exploitation is possible: Traversal components may cause file access to escape the intended repository path
Why this happens
The underlying issue is insufficient validation or containment of a user-controlled filesystem path. When path traversal sequences are accepted without ensuring that the resolved path remains within an authorized directory, an attacker may access files outside the intended scope. This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
Potential impact
- Sensitive system files, such as
/etc/shadow, may be disclosed - SSH private keys or secret environment files may be exposed
- Credentials or other secrets could be used to access additional systems
- Confidentiality of the Dokploy host or managed remote servers could be affected
General mitigation guidance
Defensive patterns focus on constraining file access to explicitly authorized locations:
- Resolve and canonicalize paths, then verify they remain within the intended repository root
- Prefer APIs that accept repository-relative identifiers rather than arbitrary filesystem paths
- Apply strict allowlists for accessible files and reject traversal components
- Limit service permissions and isolate file-reading operations from sensitive host paths
- Treat user-supplied paths as untrusted, including when they originate from authenticated users
How teams detect issues like this
- Use static analysis to identify user-controlled path values passed to filesystem APIs without containment checks
- Review file-reading code for canonicalization and authorization checks performed before access
- Monitor requests for traversal-like path components and unusual access to sensitive files
- Enforce policy checks that restrict repository-reading features to approved directories
- Automated code review tools can help flag risky path construction and file access patterns

