CVE-2026-56740
Java vulnerability analysis and mitigation

Overview

CVE-2026-56740 is an unauthenticated remote memory exhaustion vulnerability in the JLine3 Telnet server (remote-telnet module) that allows an attacker to crash the host JVM via heap exhaustion. The flaw affects org.jline:jline-remote-telnet versions prior to 4.2.1, with version 4.2.1 being the patched release. It was discovered by Michał Majchrowicz and Marcin Wyczechowski of the AFINE Team and published on June 17, 2026. The vulnerability carries a CVSS v3.1 base score of 7.5 (High) (GitHub Advisory).

Technical details

The root cause is CWE-400 (Uncontrolled Resource Consumption): TelnetIO.readNEVariables() (lines 1127–1180 of TelnetIO.java) processes incoming Telnet NEW-ENVIRON variable pairs in an unbounded loop, storing each pair in a HashMap held by ConnectionData. While per-variable limits exist (name: max 50 chars, value: max 1000 chars), there is no cap on the total number of variables per connection. The backing HashMap is initialized with a capacity of 20 and no maximum size (ConnectionData.java:98). Each map entry consumes approximately 2 KB of heap; on a 512 MB JVM, roughly 250,000 unique entries trigger an OutOfMemoryError. Critically, NEW-ENVIRON negotiation occurs before authentication, so no credentials are required to exploit this flaw (GitHub Advisory, GHSA).

Impact

Successful exploitation causes a Denial of Service via JVM heap exhaustion (OutOfMemoryError), crashing the host process or severely degrading all services sharing that JVM instance. A single unauthenticated connection sending approximately 3–4 MB of crafted Telnet traffic is sufficient to exhaust a 512 MB JVM heap, affecting all users of any application embedding the jline-remote-telnet module. There is no confidentiality or integrity impact; the vulnerability is purely an availability risk (GitHub Advisory).

Exploitation steps

  1. Reconnaissance: Identify services exposing the JLine3 Telnet server (default Telnet port 23 or custom port) using network scanners such as Nmap or Shodan, targeting applications using org.jline:jline-remote-telnet < 4.2.1.
  2. Establish Telnet connection: Connect to the target Telnet server and complete standard Telnet option negotiation (IAC DO NEW-ENVIRON, IAC WILL NEW-ENVIRON).
  3. Trigger NEW-ENVIRON negotiation: Wait for or solicit the server's IAC SB NEW-ENVIRON SEND IAC SE subnegotiation request.
  4. Send malicious IS subnegotiation: Respond with a crafted IAC SB NEW-ENVIRON IS message containing a large number of unique variable pairs (e.g., sequential 1-byte names \x01, \x02, ... with 1-byte values), withholding the terminating IAC SE until all pairs are sent. Each pair requires ~13 protocol bytes; 250,000 pairs (~3.25 MB) are sufficient to exhaust a 512 MB JVM heap.
  5. Trigger OOM: Send the final IAC SE byte. The server's connection thread, which has been blocking on socket reads while accumulating entries into the unbounded HashMap, triggers an OutOfMemoryError, crashing the JVM or causing severe degradation for all co-hosted services (GitHub Advisory).

Indicators of compromise

  • Network: Unusually large Telnet subnegotiation payloads (multi-megabyte IAC SB NEW-ENVIRON IS messages) from a single source IP; high-volume Telnet connections that remain open for extended periods without completing login.
  • Logs: JVM crash logs or java.lang.OutOfMemoryError entries in application logs, particularly referencing heap space exhaustion; sudden process termination of the Java application hosting the Telnet server.
  • Process: Abnormal JVM memory usage growth correlated with an active Telnet connection; JVM GC logs showing continuous full GC cycles with no heap recovery prior to crash (GitHub Advisory).

Mitigation and workarounds

Upgrade org.jline:jline-remote-telnet to version 4.2.1 or later, which is the patched release addressing this vulnerability. If an immediate upgrade is not feasible, consider restricting network access to the Telnet server port using firewall rules to trusted IP ranges, or disabling the remote-telnet module entirely if it is not required. No official configuration-based workaround short of network-level access control has been documented (GitHub Advisory, GHSA).

Community reactions

The vulnerability was credited to Michał Majchrowicz and Marcin Wyczechowski of the AFINE Team, and the advisory was published by JLine3 maintainer gnodet on June 17, 2026. No significant broader media coverage, vendor statements beyond the advisory, or notable social media commentary has been identified at this time (GitHub Advisory).

Additional resources


SourceThis report was generated using AI

Related Java vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

GHSA-r7wm-3cxj-wff9HIGH8.7
  • Java logoJava
  • com.fasterxml.jackson.core:jackson-core
NoYesJul 21, 2026
CVE-2026-56741HIGH7.5
  • Java logoJava
  • jline3
NoYesJul 17, 2026
CVE-2026-56740HIGH7.5
  • Java logoJava
  • apache-nifi
NoYesJul 17, 2026
CVE-2026-47695HIGH7.1
  • Java logoJava
  • cc.tweaked:cc-tweaked-1.20-core
NoYesJul 21, 2026
GHSA-mhm7-754m-9p8wMEDIUM6.5
  • Java logoJava
  • com.fasterxml.jackson.core:jackson-databind
NoYesJul 21, 2026

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management