/

CVE-2026-57856

Severity:

HIGH RISK

(8.8)

Path Traversal (CWE-22) in Cockpit CMS Bucket API

CVE-2026-57856

Deferred

Vulnerability type

Category:

Path Traversal

CWE:

CWE-22

Impact:

Unauthorized file access and modification across storage buckets

Severity:

HIGH RISK

(8.8)

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

Cockpit CMS's bucket file storage API improperly sanitizes bucket names, allowing directory traversal via .. and ../ sequences that are normalized but not blocked.

An authenticated low-privileged user can abuse this flaw to list, upload, and delete files across all buckets, including those owned by other users or roles, whenever the Bucket API is exposed.

Affected context

The vulnerability arises in Cockpit CMS deployments that use the Bucket file storage API under /system/buckets/api.

It manifests when:

  • Bucket names are accepted from user-controlled input
  • The application relies on simple character whitelisting and path normalization
  • The underlying filesystem abstraction (Flysystem) treats buckets/.. as a valid path and resolves it to the uploads storage root

In such configurations, bucket operations can unintentionally target directories outside the intended bucket scope.

Exploit preconditions

  • Attack surface: HTTP requests targeting the Bucket file storage API (/system/buckets/api)
  • Required access: Authenticated user with minimal permissions to interact with buckets
  • Trigger point: Supplying a crafted bucket name containing .. or ../ sequences to the api() method
  • Why exploitation is possible: The sanitization regex removes disallowed characters but still permits .. segments, and Flysystem's path normalizer resolves buckets/.. to the storage root without flagging traversal, allowing the attacker's bucket operations to escape their authorized bucket directory.

Why this happens

This issue stems from insufficient path validation and reliance on naive input sanitization for filesystem paths.

The api() controller uses a regex-based whitelist that strips certain characters but does not reject or normalize out directory traversal segments such as .. and ../.

When these sanitized values are interpolated into filesystem paths managed by Flysystem, the path normalizer legally resolves buckets/.. to the higher-level storage root.

Conceptually, this matches CWE-22: Improper Limitation of a Pathname to a Restricted Directory, where user-controlled path components are allowed to influence directory resolution beyond their intended scope.

Potential impact

  • An authenticated low-privileged user may list files stored in other users' buckets
  • Attackers could upload arbitrary files into other buckets, potentially influencing application behavior or content
  • Existing files across buckets can be deleted or overwritten, leading to data loss or corruption
  • Sensitive assets stored in buckets, such as media or configuration-related artifacts, could be exposed or tampered with

General mitigation guidance

Effective mitigation centers on enforcing strict directory boundaries and rejecting unsafe path constructs.

Common defensive patterns include:

  • Validating bucket identifiers against a constrained, canonical format (e.g., fixed slugs or IDs) rather than raw path segments
  • Explicitly detecting and rejecting path traversal markers such as .., ../, and redundant separators before constructing filesystem paths
  • Mapping logical bucket names to internal, non-user-controllable directory names so that user input cannot directly shape filesystem paths
  • Applying authorization checks at the logical bucket level for read, write, and delete operations, ensuring that operations are tied to the owning user or role
  • Configuring storage layers so that application-level buckets are confined to dedicated subdirectories with no ability to escape via relative path resolution

How teams detect issues like this

Organizations can detect similar path traversal issues by:

  • Using static analysis rules to flag any interpolation of user input into filesystem paths, particularly when combined with relative segments
  • Reviewing controller and storage-layer code for regex-based sanitization that does not explicitly handle .. and other traversal constructs
  • Implementing security-focused unit and integration tests that attempt bucket names with ../, extra slashes, and ambiguous whitespace to verify enforcement
  • Applying runtime monitoring or logging that records bucket names and path resolutions, alerting on suspicious patterns involving traversal markers
  • Employing automated code review tools or SAST solutions configured with checks for CWE-22 patterns in file handling and storage APIs

Sources

SourceLink
gist.github.comgist.github.com/sermikr0/821c4edd3c34e98a62a50b07707785bd
github.comgithub.com/Cockpit-HQ/Cockpit/commit/dde2d1d74f5f4e11de42a298918ea8c9684f932c
github.comgithub.com/cockpit-hq/cockpit
vulncheck.comvulncheck.com/advisories/cockpit-cms-missing-authorization-in-bucket-file-storage-api
vulncheck.comvulncheck.com/advisories/cockpit-cms-path-traversal-via-bucket-name-in-bucket-file-storage-api

Frequently asked

questions

Exploitation is limited to authenticated users who can reach the Bucket file storage API, but within that scope, a single low-privileged account can interact with files across all buckets if path traversal is not blocked.

The attacker needs valid credentials with minimal permissions that allow bucket operations through /system/buckets/api.

No filesystem-level access is required; all actions occur via standard HTTP requests.

The most robust fix is to decouple user-facing bucket identifiers from actual filesystem paths, validate bucket names against a strict, traversal-free format, and ensure authorization checks enforce ownership before performing any file operation.

Future implementations should treat all path-related user input as untrusted, block .. and other traversal constructs explicitly, rely on canonical, server-generated directory mappings, and incorporate security reviews and automated checks for CWE-22 in the development lifecycle.

Find out what's already
exploitable in your codebase.