cloudpathlib is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
60
CVE Score
Medium
Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
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.
Upgrade the cloudpathlib package to version 0.25.0 or later.
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.
0.1.0 - 0.24.0
Fixed in 0.25.0cloudpathlib is vulnerable to Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in versions 0.1.0 - 0.24.0.
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.
I consent to receiving marketing communications based on Aikido’s Privacy Policy.
SOC 2Compliant
ISO 27001Compliant
ISO 42001Compliant© All Intel data is openly available and commercially licensed.