The vulnerability is a remote command execution flaw in rclone's remote control (RC) interface. The root cause is an authentication bypass on the operations/fsinfo endpoint. The analysis of the patch and the vulnerability description reveals a chain of function calls that lead to the exploit.
-
The init function in fs/operations/rc.go registers the operations/fsinfo endpoint. The vulnerability existed because this registration was missing AuthRequired: true, making the endpoint accessible to unauthenticated users. The patch adds this authentication requirement.
-
During an exploit, an attacker sends a request to the operations/fsinfo endpoint, which is handled by the operations.rcFsInfo function. This function is the entry point for the exploit.
-
rcFsInfo takes the attacker's input and passes it to rc.GetFs. This function is designed to create backend configurations on-the-fly from user input.
-
The attacker crafts the input to specify a webdav backend and includes the bearer_token_command parameter, which contains the command to be executed.
-
This malicious configuration is used to initialize a new WebDAV backend by calling webdav.NewFs.
-
During initialization, webdav.NewFs detects the bearer_token_command and calls webdav.fetchBearerToken.
-
Finally, webdav.fetchBearerToken executes the attacker's command using exec.Command.
Therefore, the functions operations.rcFsInfo, rc.GetFs, webdav.NewFs, and webdav.fetchBearerToken would all appear in a runtime profile or stack trace during the exploitation of this vulnerability.