/

CVE-2026-44973

Severity:

HIGH RISK

(8.1)

Path Traversal in go-billy Filesystem Abstractions

CVE-2026-44973

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized Filesystem Access

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

Multiple path traversal flaws in the go-billy filesystem abstraction allow crafted paths (for example those containing ..) to escape intended base directories.

Applications that assume go-billy enforces directory boundaries for isolation may inadvertently expose access to unintended filesystem locations, potentially enabling read or write operations outside the expected scope.

Affected context

This vulnerability affects Go applications that use go-billy as a filesystem abstraction and rely on it to restrict file operations to a particular base directory or virtual filesystem.

The risk is elevated when:

  • User-controlled or externally supplied paths are passed directly into go-billy operations
  • The application assumes that go-billy consistently enforces path boundaries across its implementations
  • go-billy is used as part of a sandbox, isolation layer, or multi-tenant boundary

In such scenarios, inadequate path sanitization may allow access outside the intended directory tree.

Exploit preconditions

  • Attack surface: Any API endpoint, RPC handler, CLI command, or plugin interface that accepts path input and uses go-billy for filesystem operations.
  • Required access: Ability to supply or influence file paths passed into go-billy (for example, through HTTP parameters, request bodies, configuration, or user input).
  • Trigger point: Invocation of go-billy methods (such as open, create, remove, stat, or list) with crafted paths that include traversal sequences (e.g., ../) or equivalent encodings.
  • Why exploitation is possible: Some go-billy filesystem implementations perform insufficient normalization and boundary checks, allowing traversal sequences to resolve to locations outside the configured base directory, despite callers expecting isolation.

Why this happens

The core issue aligns with CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

Internally, go-billy components are responsible for mapping logical paths to real filesystem locations or backing stores. In affected versions, certain implementations do not robustly normalize and validate incoming paths before resolution. They may:

  • Concatenate user-supplied paths to a base path without canonicalization
  • Inconsistently handle .., . and redundant separators
  • Fail to re-check that the resolved path remains under the intended root

This leads to a mismatch between the caller's mental model (that go-billy provides a bounded filesystem rooted at a base directory) and the actual behavior, where crafted traversal paths can escape that boundary.

Potential impact

  • Read access to files outside the intended working directory, including configuration or data files that the process can read.
  • Overwriting, creating, or deleting files in unintended filesystem locations, depending on the permissions of the running process.
  • Corruption or manipulation of application data stored outside the expected virtual filesystem.
  • Escalation of impact when combined with other vulnerabilities (e.g., writing to configuration or script directories to influence subsequent code execution).
  • Unauthorized disclosure of sensitive information through exfiltration of logs, keys, or other secrets stored on disk and reachable by the application.

General mitigation guidance

Mitigation typically focuses on defensive path handling and clear isolation boundaries in applications that use go-billy:

  • Treat all paths influenced by untrusted input as unsafe until they are canonicalized and validated against an allowed root.
  • Normalize paths (resolving .., ., and redundant separators) and then enforce that the canonical path remains strictly under an expected base directory before passing it into filesystem operations.
  • Introduce an explicit path validation layer in the application that is independent of library-specific behavior, rather than assuming library-level isolation guarantees.
  • Prefer whitelisting of allowed path patterns or resource identifiers over exposing raw filesystem paths directly to users.
  • Run components that handle user-supplied paths with the least filesystem privileges necessary (e.g., restricted service accounts, minimal directory access, containers with scoped volumes).
  • Clearly document internally that filesystem abstraction libraries like go-billy are convenience layers and not full security sandboxes unless explicitly designed and verified as such.

How teams detect issues like this

Effective detection combines code-level inspection with policy controls:

  • Static analysis and code review:
  • Identify call sites where user-controlled input is passed directly as a path argument into go-billy methods without prior normalization or validation.
  • Look for direct string concatenation of base directories with user-supplied segments (e.g., base + "/" + userPath) before go-billy is invoked.
  • Flag implementations that do not check that resolved paths remain within an expected root after resolution.
  • Policy and architectural review:
  • Review components that treat go-billy-backed filesystems as security boundaries or sandboxes; confirm that assumptions about isolation are explicit and verified.
  • Enforce guidelines that all filesystem accesses derived from external input must pass through a centralized path validation utility.
  • Automated tooling:
  • Configure static analysis tools or custom linters for Go to search for path traversal patterns and insufficient path sanitization.
  • Integrate these checks into CI pipelines so that new uses of go-billy with unsanitized paths are surfaced early in development.

Sources

SourceLink
github.comgithub.com/go-git/go-billy/security/advisories/GHSA-qw64-3x98-g7q2

Frequently asked

questions

It can be, depending on how the application exposes filesystem operations. If remote users can influence paths passed into go-billy (for example via HTTP APIs or uploaded metadata), the vulnerability surface becomes remotely reachable.

An attacker needs the ability to provide or manipulate path values used in go-billy calls. They do not necessarily need direct system shell access; control over application-level inputs that map to paths may be sufficient.

Introduce a robust, centralized path handling layer that canonicalizes and validates all paths against a configured root before any filesystem operation. Do not rely solely on library-specific behavior for isolation, and enforce that resolved paths cannot escape the allowed directory.

Treat filesystem abstractions as convenience layers rather than hard security boundaries unless explicitly designed and audited as such. Apply strict input validation to all path-based operations, limit filesystem privileges of services, and incorporate security-focused code review and static analysis rules that specifically flag potential path traversal patterns.

Find out what's already
exploitable in your codebase.