davidhtien / ganymed-ssh-2

Automatically exported from code.google.com/p/ganymed-ssh-2
Other
0 stars 0 forks source link

Disconnect when SSH server sends data with zero payload #32

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
When SSH server sends data with zero payload - SSH_MSG_CHANNEL_DATA message 
with length 9 the Ganymed client throws an exception and disconnects

A data message with zero payload should be handled and silently discarded. 
Instead, the msgChannelData function will throw an IOException 
"SSH_MSG_CHANNEL_DATA message has wrong size ("  9  ")". The client then 
disconnects

SSH-2.0-Ganymed_261
OS X 10.9.1

The Ganymed client check the length of SSH data message when it is received. 
When the SSH server send a data packet with zero payload, which is apparently 
ok with the RFC, the Ganymed SSH client receive thread throws an exception that 
cause a disconnect.
The ChannelManager msgChannelData() lengh check should be msglen < 9, not 
msglen ≤9 as data packets without payload are not forbidden by the SSH 
Connection Protocol RFC.

Original issue reported on code.google.com by conny.oh...@gmail.com on 9 Jan 2014 at 9:13

Attachments:

GoogleCodeExporter commented 8 years ago

Original comment by cleondris on 10 Feb 2014 at 11:37

GoogleCodeExporter commented 8 years ago
Can you provide a patch and a test case if possible.

Original comment by dkocher@sudo.ch on 9 Apr 2014 at 7:41

GoogleCodeExporter commented 8 years ago

Original comment by dkocher@sudo.ch on 12 Apr 2014 at 8:32