An arbitrary file write issue exists in the `sftpRecursivePullFile()` function. A malicious incus-agent can escape the target directory during an `incus file pull -r` operation. An attacker with root privileges in a virtual machine can manipulate the process by returning duplicate entries, reporting them first as symlinks and subsequently as files or directories. This allows the attacker to write controlled files, such as `/etc/shadow`, directly onto the operator's host system.