An issue was discovered in OpenSSH 7.9. Due to the scp implementation being derived from 1983 rcp, the server chooses which files/directories are sent to the client. However, the scp client only performs cursory validation of the object name returned (only directory traversal attacks are prevented). A malicious scp server (or Man-in-The-Middle attacker) can overwrite arbitrary files in the scp client target directory. If recursive operation (-r) is performed, the server can manipulate subdirectories as well (for example, to overwrite the .ssh/authorized_keys file).
https://sintonen.fi/advisories/scp-client-multiple-vulnerabilities.txt
https://cvsweb.openbsd.org/src/usr.bin/ssh/scp.c
https://www.exploit-db.com/exploits/46193/
http://www.securityfocus.com/bid/106741
https://usn.ubuntu.com/3885-1/
https://www.debian.org/security/2019/dsa-4387
https://security.netapp.com/advisory/ntap-20190213-0001/
https://bugzilla.redhat.com/show_bug.cgi?id=1677794
https://usn.ubuntu.com/3885-2/
https://security.gentoo.org/glsa/201903-16
https://lists.debian.org/debian-lts-announce/2019/03/msg00030.html
http://www.openwall.com/lists/oss-security/2019/04/18/1
https://lists.apache.org/thread.html/c45d9[email protected]%3Cdev.mina.apache.org%3E
https://lists.apache.org/thread.html/[email protected]%3Cdev.mina.apache.org%3E
https://lists.apache.org/thread.html/[email protected]%3Cdev.mina.apache.org%3E
http://lists.opensuse.org/opensuse-security-announce/2019-06/msg00058.html
https://www.freebsd.org/security/advisories/FreeBSD-EN-19:10.scp.asc
https://lists.apache.org/thread.html/[email protected]%3Cdev.mina.apache.org%3E
https://www.oracle.com/technetwork/security-advisory/cpuoct2019-5072832.html
https://access.redhat.com/errata/RHSA-2019:3702
http://www.openwall.com/lists/oss-security/2022/08/02/1
https://cert-portal.siemens.com/productcert/pdf/ssa-412672.pdf
Source: MITRE
Published: 2019-01-31
Updated: 2023-03-24
Type: CWE-22
Base Score: 5.8
Vector: AV:N/AC:M/Au:N/C:N/I:P/A:P
Impact Score: 4.9
Exploitability Score: 8.6
Severity: MEDIUM
Base Score: 5.9
Vector: CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:H/A:N
Impact Score: 3.6
Exploitability Score: 2.2
Severity: MEDIUM