/

CVE-2026-121448

Severity:

HIGH RISK

(8.3)

Path Traversal (CWE-22) in Dockhand Stack Env Endpoint

CVE-2026-121448

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file access and modification

Severity:

HIGH RISK

(8.3)

CVSS version:

3.1

Catch this CVE while code is being written

Detect vulnerable code directly in pull requests, so CVEs are fixed before merge.

Summary

Dockhand's stack environment API can mishandle encoded stack names, allowing authenticated users to access .env files outside the intended stacks directory. Depending on the operation, this may expose secrets or allow files to be overwritten or deleted.

Affected context

The issue affects Dockhand's /api/stacks/[name]/env/raw endpoint when processing stack names that contain traversal sequences encoded more than once. If those names are decoded or normalized in an unsafe order, file operations may escape the stacks root and reach .env files in other locations.

Exploit preconditions

  • Attack surface: The stack environment API endpoint
  • Required access: An authenticated account able to make requests to the endpoint
  • Trigger point: Handling a stack name containing double-encoded traversal sequences
  • Why exploitation is possible: Path validation or normalization may not account for repeated decoding, allowing the resolved file path to fall outside the permitted stacks root

Why this happens

The underlying issue is improper restriction of a user-influenced file path. If an application validates an encoded path before fully decoding and canonicalizing it, traversal components may remain hidden during checks and later resolve outside the intended directory.

This maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'). The insecure pattern is using untrusted path components in file operations without reliably enforcing the final canonical path boundary.

Potential impact

  • Attackers may read .env files and disclose secrets across environments.
  • Attackers could overwrite files in protected directories.
  • Attackers could delete files outside the stacks root.
  • Deployment variables may be poisoned, potentially changing application or deployment behavior.

General mitigation guidance

Defensive approaches focus on preventing user-controlled names from escaping an explicitly permitted directory.

  • Map stack identifiers to server-controlled paths rather than accepting filesystem paths from requests.
  • Decode and canonicalize input consistently before applying path-boundary checks.
  • Confirm that the final resolved path remains beneath the permitted root for every file operation.
  • Use filesystem APIs and directory permissions that limit access to the intended files.
  • Minimize the privileges of the service account and restrict access to secrets and protected directories.
  • Treat request parameters as untrusted and validate them against a strict, allowlisted format.

How teams detect issues like this

Review file-handling code for request parameters used in path construction, especially where decoding, normalization, and validation occur in different stages. Static analysis can flag user-controlled paths passed to file read, write, or delete operations.

Monitor requests and application logs for suspicious encoded traversal patterns and for file operations that resolve outside the stacks root. Policy checks can require canonical path-boundary validation and tests covering repeated encoding and all supported file operations.

Sources

SourceLink
github.comgithub.com/Finsys/dockhand/security/advisories/GHSA-q2vc-4qcx-2vm6
vulncheck.comvulncheck.com/advisories/dockhand-before-1.0.54-path-traversal-via-stack-environment-routes

Frequently asked

questions

The described attack requires an authenticated user who can access the stack environment API.

Depending on the operation and filesystem permissions, an attacker may read, overwrite, or delete .env files outside the stacks root.

Resolve paths from server-controlled identifiers, canonicalize them, and verify that the final path remains within the permitted directory before performing any file operation.

Treat request values as untrusted, enforce strict validation and path-boundary checks, limit service privileges, and test file operations against encoded traversal inputs.

Find out what's already
exploitable in your codebase.