Your RSA-2048 keys break in 2030. Find every one of them before attackers do.
Maven
Not in CISA KEV

CVE-2026-54697

CVE-2026-54697 is a remote code execution vulnerability in org.connectbot.sshlib:sshlib. O3 Security confirms whether CVE-2026-54697 is actually reachable in your code before you act, and blocks exploitation at runtime until you patch.

ConnectBot SSH Client Library: Excessive allocation and integer overflow in DER private-key parsing

Published
Jun 12, 2026
Updated
Jul 8, 2026
Affected
1 pkg
Patched
None yet
Exploits
None indexed
Exploitation data as of Jul 8, 2026 · OSV.dev, FIRST.org (EPSS)

Real-World Exposure

1 pkg affected
org.connectbot.sshlib:sshlib

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.

Description

Summary

The DER parser used for application-supplied private keys did not safely validate encoded length values before converting them to Int values or allocating arrays.

A malformed private-key file could encode a length that overflowed or wrapped around, or request an allocation much larger than the available input. This could cause parsing errors or an uncaught OutOfMemoryError, potentially terminating the application process.

Details

The issue was in DerReader.readLength() and primitive readers such as readInteger().

readLength() previously accepted up to 127 length octets and accumulated them into an Int:

length = (length shl 8) or nextByte

This permitted integer overflow. For example:

  • 0x1_0000_0001 wrapped to 1.
  • 0x8000_0000 wrapped to Int.MIN_VALUE.

Primitive readers then allocated memory based on the resulting value without first checking it against the remaining input:

val bytes = ByteArray(length)
data.get(bytes)

A six-byte DER value declaring a 1 GiB INTEGER caused an immediate OutOfMemoryError when tested with a constrained JVM heap. Because OutOfMemoryError is not an Exception, it is not caught by the public-key authentication error handling and may terminate the application process.

A zero-length DER INTEGER is also invalid, but it does not produce BigInteger.ZERO: Java throws NumberFormatException when constructing a BigInteger from an empty byte array. No weakened or usable cryptographic key has been demonstrated through this issue.

Attack Requirements

The affected DER parser processes private-key material explicitly supplied by the application through APIs such as:

  • SshClient.authenticatePublicKey()
  • SshKeys.decodePemPrivateKey()
  • SshSigning.sign()
  • SshSigning.getPublicKey()

The DER input is not populated from SSH server host keys or agent-forwarding requests. Exploitation therefore requires a user or application to load an attacker-provided private-key file. The issue is not remotely exploitable by an SSH server.

Impact

Successful exploitation can cause:

  • Incorrect DER length interpretation due to integer wraparound
  • Excessive memory allocation
  • An uncaught OutOfMemoryError
  • Loss of availability of the affected application process

There is no demonstrated confidentiality or integrity impact.

Remediation

The DER parser now:

  • Rejects indefinite lengths
  • Explicitly limits long-form lengths to Int.SIZE_BYTES (four octets) and rejects values above Int.MAX_VALUE
  • Accumulates long-form lengths in a Long before converting to Int
  • Rejects truncated and non-minimal length encodings
  • Checks declared lengths against the remaining input before allocation or advancing the input position
  • Rejects zero-length DER INTEGER, BIT STRING, and OBJECT IDENTIFIER values where an empty encoding is invalid
  • Rejects non-canonical DER INTEGER encodings with redundant sign octets

The bounds checks are implemented in shared DER reader helpers and apply to INTEGER, OCTET STRING, BIT STRING, OBJECT IDENTIFIER, SEQUENCE, context-specific values, and skipped values. PKCS#1 RSA and SEC1 EC private keys pass application-supplied DER directly through these helpers. PKCS#8 input is parsed by the JCA provider, and OpenSSH private keys use a separate wire-format parser rather than DerReader.

Affected Packages

1 total
EcosystemPackageVulnerable rangeFix
Mavenorg.connectbot.sshlib:sshliball versionsNo fix

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.connectbot.sshlib:sshlib. O3's reachability analysis confirms whether the vulnerable code path is actually invoked in your application, so you act on real exposure instead of every transitive match.

  2. Remediation status

    No patched version of org.connectbot.sshlib:sshlib has shipped for CVE-2026-54697 yet. Where your build allows, override or pin the dependency away from the vulnerable range, and apply any maintainer-recommended mitigation.

  3. Mitigate without a patch

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

  4. How O3 protects you

    O3 pinpoints whether CVE-2026-54697 is reachable in your code and exactly where to fix it, then blocks exploitation in production at runtime until the patched version is deployed.

Tailored to CVE-2026-54697. Runtime protection reduces exposure until a permanent patch is applied and verified — it complements patching, it doesn't replace it.

Frequently Asked Questions

## Summary The DER parser used for application-supplied private keys did not safely validate encoded length values before converting them to `Int` values or allocating arrays. A malformed private-key file could encode a length that overflowed or wrapped around, or request an allocation much larger than the available input. This could cause parsing errors or an uncaught `OutOfMemoryError`, potentially terminating the application process. ## Details The issue was in `DerReader.readLength()` and primitive readers such as `readInteger()`. `readLength()` previously accepted up to 127 length oc
O3 Security · Impact-Aware SCA

Is CVE-2026-54697 in your dependencies?

O3 detects CVE-2026-54697 across Maven dependencies and uses function-level reachability to confirm whether the vulnerable code path is actually reachable — not just present. No false positives.

CVE-2026-54697: sshlib | O3 Security