CVE-2025-24366 Insufficient sanitization of user provided rsync command in SFTPGo
Authenticated users can inject rsync options to read or write files on the server if the optional rsync command is enabled.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Over the internet
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-24366?
CVE-2025-24366 is a high-severity command injection vulnerability in drakkan sftpgo, published on 7 Feb 2025. Any signed-in user can exploit it over the network, with no action from the victim.
Official description
SFTPGo is an open source, event-driven file transfer solution. SFTPGo supports execution of a defined set of commands via SSH. Besides a set of default commands some optional commands can be activated, one of them being `rsync`. It is disabled in the default configuration and it is limited to the local filesystem, it does not work with cloud/remote storage backends. Due to missing sanitization of the client provided `rsync` command, an authenticated remote user can use some options of the rsync command to read or write files with the permissions of the SFTPGo server process. This issue was fixed in version v2.6.5 by checking the client provided arguments. Users are advised to upgrade. There are no known workarounds for this vulnerability.
Weakness: CWE-78
Which versions are affected by CVE-2025-24366?
6 open source packages ship an affected version, including github.com/drakkan/sftpgo and github.com/drakkan/sftpgo/v2.
| Package | Affected | Fixed in |
|---|---|---|
github.com/drakkan/sftpgo Go | All versions | None |
github.com/drakkan/sftpgo Go | All versions to 1.2.2 | None |
github.com/drakkan/sftpgo Go | All versions to 1.2.2 | None |
github.com/drakkan/sftpgo/v2 Go | All versions | 2.6.5 |
github.com/drakkan/sftpgo/v2 Go | From 0.9.5 | 2.6.5 |
github.com/drakkan/sftpgo/v2 Go | From 0.9.5 | 2.6.5 |
How do I fix CVE-2025-24366?
Upgrade to a fixed version.
Upgrade, and pass arguments to programs as a list instead of through a shell. More about Command injection.
Is CVE-2025-24366 being exploited?
There is no known exploitation of CVE-2025-24366 in the wild and no public exploit code.
Sources
Also known as GHSA-vj7w-3m8c-6vpx, GO-2025-3458.