A flaw was found in OpenSSH. During an sftp copy, a malicious server can supply an empty name, a slash-only path, or a ".." basename that sftp uses as the local destination, writing outside the directory the user selected.
Do not use sftp to copy from a server you do not trust. There is no configuration switch that closes this path.