The vulnerability is a path traversal issue that allows an attacker to write arbitrary files during package installation. The root cause lies in the rattler_conda_types::package::entry_point::EntryPoint::from_str function, which parses entry point specifications from package metadata. Prior to the fix, this function did not properly sanitize the 'command' part of the entry point string, allowing path traversal characters like .., /, and \. This malicious 'command' string is then stored in an EntryPoint object.
This tainted EntryPoint object is later used by rattler::install::entry_point::create_windows_python_entry_point and rattler::install::entry_point::create_unix_python_entry_point to generate and write entry point scripts to the filesystem. These functions would construct a file path by joining the malicious 'command' to a base directory, resulting in a path that points outside the intended installation prefix. This allows a specially crafted package to write or overwrite files anywhere the user running the installation has write permissions.
The patch addresses this by introducing two layers of validation. First, EntryPoint::from_str is updated to strictly validate the 'command' as a simple filename, rejecting any path separators or traversal sequences. Second, the functions that write to the filesystem in rattler::install::entry_point were updated to use a new ensure_entry_point_relative_path function, which performs a defense-in-depth check to ensure the final path is within the installation prefix before any file is written.