Uploaded image for project: 'MINA SSHD'
  1. MINA SSHD
  2. SSHD-269

Random Data corruption with Remote Port Forwarding

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Fixed
    • 0.9.0
    • 0.10.0
    • None
    • WIN7 + JDK7, Centos+OpenJDK7

    Description

      A TCP connection set up over Remote Port Forwarding feature randomly garbles the data. On further testing I found that the TCP stream from remote-to-local is unaffected whereas the local-to-remote is bad.

      To reproduce,
      1. setup a basic sshd. listen on port 22. call the host 'remote'.
      2. on 'local' machine set up putty (ssh client) as follows:
      2.1 Host name: remote
      2.2 Port: 22
      2.3 Connection-SSH: Dont start a shell or command at all
      2.4 Connection-SSH-tunnels:: source-port: remote-port, destination: localhost:localport
      2.5 Connection type: Remote [Click ADD]
      2.6 Open connection

      this makes a tunnel from remoteserver:remoteport to localhost:localport

      3. set up a basic TCP server on localhost:localport
      3.1 start serving predictable byte arrays.

      {0000111112222....}

      4. set up a basic TCP client. connect to remoteHost:remotePort
      4.1 the connection automatically gets forwarded to localhost:localport where my own TCP server is running. hence a TCP connection is setup over the tunnel.
      5. start consuming the byte array from server.
      5.1 match the incoming bytes to expected sequence.

      you will see that the sequence is oftentimes garbled.

      6. let the client send a similar predictable byte stream to server.
      6.1 from client take OutputStream from the socket and push a long but predictable byte array in it.
      6.2 from server get InputStream out of socket and read the bytes

      you will see that irrespective of array length, all the bytes are safely delivered.

      Attachments

        1. Module1.vb
          4 kB
          Abhishek Ganguly

        Activity

          People

            gnodet Guillaume Nodet
            abhishek.ganguly@crestechglobal.com Abhishek Ganguly
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: