Oh, SSH, IT Please see This: Malicious Servers can Fsck With Your PC's Files During scp Slurps
A decades-old oversight in the design of Secure Copy Protocol (SCP) tools can be exploited by malicious servers to unexpectedly alter victims' files on their client machines, it has emerged.
F-Secure's Harry Sintonen discovered a set of five CVE-listed vulnerabilities, which can be abused by evil servers to overwrite arbitrary files on a computer connected via SCP. If you use a vulnerable version of OpenSSH's scp, PuTTY's PSCP, or WinSCP, to securely transfer files from a remote server, that server may be able to secretly tamper with files on your local box that you do not expect the server to change.
[...] Sintonen explained that because rcp, on which scp is based, allows a server to control which files are sent, and without the scp client thoroughly checking it's getting its expected objects, an attacker can do things like overwrite the user's .bash_aliases file. This, in turn, would allow the attacker to run arbitrary commands on the victim's box when the user does routine stuff, like list a directory.
"Many scp clients fail to verify if the objects returned by the scp server match those it asked for. This issue dates back to 1983 and rcp, on which scp is based," Sintonen explained in his disclosure this month.
"A separate flaw in the client allows the target directory attributes to be changed arbitrarily. Finally, two vulnerabilities in clients may allow server to spoof the client output."
The CVE (Common Vulnerabilities and Exposures) reports are:
Only WinSCP seems to have released an update that fixes these.
(Score: 1, Interesting) by Anonymous Coward on Tuesday January 15 2019, @11:23PM (2 children)
What would be really scary would be if /sending/ could be tampered with as well. Copying public keys is probably the most common use of scp outside of personally controlled networks (ssh-copy-id doesn't use it though), so if the ssh server that is receiving your key can tamper with your files during that process, it could be a serious vector for exploitation.
(Score: 0) by Anonymous Coward on Wednesday January 16 2019, @01:53AM (1 child)
It doesn't sound really scary, or even a little scary.
You're suggesting that someone, who already has root access to replace the sshd with a corrupted one, would then be able to...
They can do that already, not that it matters; they're called public keys for a reason.
Yeah, they can do that already too.
(Or they can just "su acoward".)
See above re public keys.
Seriously, what do you think this allows them to do that they can't already do?
(Score: 0) by Anonymous Coward on Wednesday January 16 2019, @03:15AM
If you're copying your public key to a server, and the server can modify files on YOUR machine, that's scary.