The vulnerability lies in the Rancher Manager cluster import endpoint /v3/import/{token}_{clusterId}.yaml, which accepts an authImage query parameter. The analysis of the provided patch commit 2aa77eb283e7 reveals that the function ClusterImport.ClusterImportHandler in pkg/api/norman/customization/clusterregistrationtokens/import.go is responsible for handling this endpoint. Before the patch, the authImage parameter was taken directly from the user request and used in a template to generate a Kubernetes manifest without proper validation. This allowed an attacker to craft a malicious authImage value with URL-encoded newlines to inject arbitrary YAML, leading to command execution on the cluster. The patch introduces a new validation function, validateAuthImage, which uses reference.ParseNormalizedNamed to ensure the authImage parameter is a valid OCI image reference. The ClusterImportHandler was modified to call this validation function immediately after retrieving the authImage parameter, thus mitigating the vulnerability. Therefore, ClusterImport.ClusterImportHandler is the vulnerable function as it was the one processing the unsanitized, malicious input.