/

CVE-2026-30914

Severity:

HIGH RISK

(8.1)

Path Traversal in SFTPGo Virtual Filesystem Routing

CVE-2026-30914

Analyzed

Vulnerability type

Category:

Path Traversal / Directory Traversal

CWE:

CWE-22

Impact:

Authorization Bypass and Data Access Outside Virtual Folder Boundaries

Severity:

HIGH RISK

(8.1)

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

A path normalization discrepancy in SFTPGo's protocol handlers and internal Virtual Filesystem routing can allow crafted paths to be interpreted differently by authorization checks and the backend file access logic.

Under certain configurations, an authenticated attacker may bypass folder-level permissions or escape a configured Virtual Folder boundary by sending specially constructed file paths.

Affected context

This vulnerability affects SFTPGo deployments that use Virtual Folders or folder-level permissions to isolate users or groups.

The issue arises when:

  • Access control decisions are made on a normalized path representation in the protocol layer, but
  • The underlying Virtual Filesystem routing interprets or normalizes paths differently,
  • Allowing certain crafted paths to resolve outside of the intended folder scope or bypass checks tied to a specific directory.

It is most relevant in multi-tenant or segregated storage environments where folder boundaries are relied upon for containment.

Exploit preconditions

  • Attack surface: SFTP/SCP/FTP/HTTP file operations against an SFTPGo instance.
  • Required access: Valid authenticated account on the SFTPGo server (e.g., local user, virtual user, or identity provider-backed account).
  • Configuration conditions:
  • Virtual Folders and/or folder-level permissions are configured to restrict access.
  • The user has at least some file operation privileges within their assigned folder hierarchy.
  • Trigger point: Submission of specially crafted paths in file-related operations (upload, download, rename, list, delete, etc.).
  • Why exploitation is possible: The normalization and validation of paths used for authorization decisions differ from the normalization and resolution logic used by the internal Virtual Filesystem, creating a mismatch that can be leveraged to step outside permitted directories or bypass folder-specific rules.

Why this happens

The core issue stems from inconsistent path handling between the protocol-facing components and the internal Virtual Filesystem router.

While access control logic relies on one canonical representation of the requested path, the routing layer applies a different normalization or interpretation, allowing certain sequences to resolve to a different effective location.

This misalignment maps to CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path components are not consistently constrained to remain within a designated root.

Conceptually, the bug class is:

  • Mixing different normalization routines or assumptions for path validation and path resolution.
  • Treating validation as if it guarantees confinement, while subsequent resolution logic can reinterpret the path and escape the intended directory boundary.

Potential impact

  • An authenticated user may access files or directories outside their configured Virtual Folder boundary.
  • Folder-level access control rules may be bypassed, allowing read or write operations in restricted areas.
  • Information disclosure of other users' data or shared resources that should be isolated.
  • Unauthorized modification or deletion of files outside the attacker's assigned folders.
  • Weakening of multi-tenant isolation, potentially impacting compliance and data segregation guarantees.

General mitigation guidance

Effective mitigation focuses on consistent, restrictive path handling and defense-in-depth around directory boundaries:

  • Ensure a single, shared path normalization routine is used for both access-control decisions and Virtual Filesystem routing, so that the same logical path representation drives validation and resolution.
  • Enforce strict confinement of all user-supplied paths to a designated root directory:
  • After normalization, reject any path that attempts to navigate above the assigned base directory or into unassigned mounts.
  • Treat protocol-supplied paths as untrusted input:
  • Validate only against normalized absolute paths.
  • Disallow ambiguous constructs (multiple slashes, mixed separators, redundant dots) that can behave differently across layers.
  • Prefer configuration patterns that minimize complexity in folder mappings, such as:
  • Clearly defined Virtual Folder roots,
  • Avoiding overlapping or nested folder rules that increase the risk of routing edge cases.
  • Apply least-privilege principles when assigning folder permissions, granting only the minimal required operations (read/write/delete) and areas of the filesystem needed for each user or group.
  • Consider logging and monitoring access patterns near folder boundaries to help detect abnormal traversals or unexpected cross-folder activity.

How teams detect issues like this

Detection typically involves both code-centric and operational approaches:

  • Static analysis and code review:
  • Flag any code paths where user-controllable paths are normalized or validated in one component and then passed through a different path-handling routine for actual file access.
  • Look for multiple, independent normalization functions or custom string manipulations used before directory checks.
  • Examine Virtual Folder routing logic for assumptions that paths are already canonical or trusted when they arrive.
  • Policy enforcement and CI/CD checks:
  • Enforce internal guidelines that all file operations must go through a central path-confinement API.
  • Use automated review tools to detect direct filesystem access that bypasses confinement wrappers.
  • Runtime monitoring:
  • Enable detailed audit logging of file operations, including the requested and resolved paths and associated user identities.
  • Set up anomaly detection rules for:
  • Access to directories that should be unreachable for a given account,
  • Repeated path requests containing traversal-like patterns.
  • Security testing:
  • Incorporate directory traversal tests into regular security assessments by issuing file operations with crafted paths aimed at crossing Virtual Folder boundaries.
  • Use automated DAST or protocol fuzzers tailored to SFTP/FTP/HTTP file operations to identify inconsistencies in path handling.

Sources

SourceLink
github.comgithub.com/drakkan/sftpgo/security/advisories/GHSA-x8qh-7475-c5mp

Frequently asked

questions

Yes, it can be exploited remotely, but only by authenticated users. Any user who can connect to the SFTPGo service and perform file operations over supported protocols may attempt to exploit this path handling discrepancy.

The attacker must have valid credentials or an account that allows file operations within at least one configured folder. Anonymous or unauthenticated access alone is not sufficient; the issue arises when a real account's folder-level constraints can be bypassed.

The safest pattern is to centralize path normalization and confinement logic and ensure that both authorization checks and Virtual Filesystem routing use the same canonicalized path representation. After normalization, any path that does not reside under the user's assigned root should be rejected before any filesystem access occurs.

Use a single, well-tested path handling API for all filesystem operations, treat all incoming paths as untrusted, and enforce strict directory confinement after canonicalization. Complement this with code review practices that look specifically for path concatenation, custom normalization logic, and authorization decisions that rely on non-canonical paths, supported by automated checks in CI/CD where possible.

Find out what's already
exploitable in your codebase.