Intel

AIKIDO-2026-52658

cloudpathlib is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

GHSA-r4f8-3xc4-c8vwPublished Oct 21, 2026
October 21, 2026

60

CVE Score

Medium

Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')

Are you affected? Scan for Free

TL;DR

cloudpathlib's CloudPath.download_to and the per-backend local cache mapping (e.g. S3Path._local, HttpPath._local, and the local mock client) build a local filesystem target by directly joining the client's local cache directory or a caller-supplied destination with the cloud object key, which some backends (such as GCS) allow to contain ".." segments or backslashes/drive letters. Because the join used plain pathlib arithmetic with no containment check, a crafted key could cause the resulting local path to land outside the intended cache or destination directory on any read/write/open/download_to/copytree operation. The default configuration supplies the destination/base directory from the calling application while the object key comes from the configured cloud storage backend's listing or metadata. The fix in v0.25.0 adds _ensure_local_path_within_base(), which resolves or lexically normalizes the candidate and base paths and raises CloudPathLocalPathTraversalError when the candidate would escape the base directory, and wires this guard into cloudpath.py, http/httppath.py, s3/s3path.py, and the local mock client.

How do I fix this?

Upgrade the cloudpathlib package to version 0.25.0 or later.

Who does this affect?

You are affected if you are using a version that falls within the vulnerable range and you map cloud object keys or download/copy destinations onto local filesystem paths.

Versions

0.1.0 - 0.24.0

Fixed in 0.25.0

Background info

cloudpathlib is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in versions 0.1.0 - 0.24.0.

Get secure today,
quickly and for free.

Secure your code, cloud, and runtime in one central system. Connect a repo to discover what the reasoning agents find in your codebase.

No credit card required | Scan results in 32 seconds.

Trusted by 150k+ orgs
  • Revolut
  • n8n
  • Lovable
  • Deel
  • Prove
  • Omnea