The flaw is in how pip processes a package filename obtained from an index-provided URL. Link.__init__ already percent-decodes the URL path into self._path, but Link.filename decoded the basename a second time. As a result, a doubly encoded separator such as %252F became %2F on the first pass and / on the second, turning a single component such as a%2Fb.whl into a/b.whl. The fix removes the second decode and adds join_within_directory so download-path joins treat the name as one path component. The attacker-controlled input is a package URL supplied by an index, and exploitation requires a user or automated process to download or install a package from a malicious index. The exact operating-system behavior, specific writable targets, and coverage of every download code path are not established by the public record.