A path traversal vulnerability exists in curl <8.0.0 SFTP implementation causes the tilde (~) character to be wrongly replaced when used as a prefix in the first path element, in addition to its intended use as the first element to indicate a path relative to the user's home directory. Attackers can exploit this flaw to bypass filtering or execute arbitrary code by crafting a path like /~2/foo while accessing a server with a specific user.
https://security.netapp.com/advisory/ntap-20230420-0012/
https://security.gentoo.org/glsa/202310-12
https://lists.debian.org/debian-lts-announce/2024/03/msg00016.html