The vulnerability description clearly points to an issue in SFTP path handling related to the tilde (~) character. The provided commit 4e2b52b5f7a3bf50a0f1494155717b02cc1df6d6 modifies the Curl_getworkingpath function in lib/curl_path.c. The patch diff shows a change in the conditional logic for SFTP path resolution. Specifically, the condition for identifying a path relative to the home directory was changed from a loose check (working_path[1] == '~') to a stricter check !memcmp(working_path, "/~/", 3). This directly addresses the described vulnerability where a tilde used as a prefix (e.g., /~foo) was incorrectly processed. The function Curl_getworkingpath is the one that processes the user-provided path and constructs the final path to be used, making it the vulnerable function.
Ongoing coverage of React2Shell