The SCP middleware in charm.land/wish/v2 is vulnerable to path traversal attacks allowing an attacker to read and write arbitrary files outside the configured root directory. This occurs because the path sanitization logic fails to properly confine file operations within the root directory, enabling crafted filenames with '../' sequences to escape the root. The vulnerability affects all versions through commit 72d67e6 (current main) and likely all v1 versions of github.com/charmbracelet/wish. The flaw allows arbitrary file write, read, and directory creation on the server filesystem via SCP protocol manipulation.