Skip to content

Compatibility: cbssh 0.6.0 breaks compatibility with several (old) SSH implementations aborting connection at version banner reception #353

Closed

Description

@D000Mer

SSH server

OpenSSH 3.7.1p2

Library version

0.6.0

Area

Connection setup

Algorithms and configuration

The server sends a version string terminated with only the line feed character (the carriage return character is missing).

Observed behavior

The just established connection is aborted with the "Banner too long" message.

Expected behavior

A transition to the host key exchange phase.

The corresponding connectbot bug is 2538.

The root cause of this compatibility issue is the strict order of the carriage return and the line feed characters assumed at the end of the SSH version banner and is located in lines 742 and 743 of the sshlib/src/main/kotlin/org/connectbot/sshlib/transport/PacketIO.kt file. To fix this issue, I propose modifying the test this way:
if (bytes[bytes.size - 1] == '\r'.code.toByte() ||
bytes[bytes.size - 1] == '\n'.code.toByte()
) {
Probably, the line 740 needs to be adjusted too this way:
if (bannerBytes.size() >= 1) {
to be compatible with implementations sending only the line feed or carriage return character.

Activity

  1. kruton commented on Oct 18, 2026

    @kruton
    Member

    Thanks for the report. I'll look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions