The vulnerability is a classic path traversal issue within the rustfs storage component. Multiple functions in the LocalDisk struct, which handles file system operations, were constructing file paths by directly joining a base directory with user-supplied path parameters. The Path::join method used for this purpose resolves ../ sequences, allowing an attacker to navigate out of the intended storage volume. The exploit PoC confirms this by reading /etc/passwd via the read_file_stream function.
The security patch addresses this by centralizing path validation. Instead of calling volume_dir.join(Path::new(&path)) directly, the affected functions now call a new helper method, self.get_object_path(volume, path). This method, in turn, calls check_valid_path, which normalizes the path (resolving .. components) and then verifies that the resulting path still starts with the intended root directory. If the path falls outside this root, an InvalidPath error is returned, effectively preventing the traversal. The patch was applied to all functions performing file I/O, including those for reading, writing, deleting, and listing files, thereby closing the vulnerability across the board.