Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
1.7.0
-
None
Description
Hi in case the SSHD server receives a message for a not existing channel, it sends back a SSH_MSG_CHANNEL_FAILURE.
This behaviour is not described in RFC4254, which, I agree, is unclear about what should be do in this case.
Since the current SSHD implementation send back a SSH_MSG_CHANNEL_FAILURE message (with the local channel id), in our environment, it put the receipient in an inconsistent state.
In out enviroment happened that the receipient has sent a SSH_MSG_CHANNEL_DATA while SSHD had already closed the channel.
I fully agree that this should not happen (I will open another issue about this) but the SSH_MSG_CHANNEL_FAILURE further complicates things.
The problem can be overcome modifying line 78 of org.apache.sshd.common.session.helpers.DefaultUnknownChannelReferenceHandler
letting
case SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA: // Not sure if entirely compliant with RFC4254, but try to stem the flood wantReply = false; break; default: // do nothing
instead of
case SshConstants.SSH_MSG_CHANNEL_EXTENDED_DATA: // Not sure if entirely compliant with RFC4254, but try to stem the flood wantReply = true; break; default: // do nothing