Skip to main content
EPSS 0.9%top 42%

CVE-2026-56740: CWE-400: Uncontrolled Resource Consumption in jline jline3

0
High
Published: 07/22/2026 (07/22/2026, 00:00:00 UTC)
Source: CVE Database V5
Vendor/Project: jline
Product: jline3

Description

### Summary The JLine3 Telnet server (`remote-telnet` module) does not limit the number of environment variables a client may inject via the Telnet NEW-ENVIRON option. An unauthenticated attacker can flood the server with a large number of unique variable pairs before sending the terminating IAC SE byte, exhausting JVM heap memory and causing an OutOfMemoryError (denial of service). Approximately 3–4 MB of network traffic is sufficient to consume a 512 MB JVM heap. ### Details `TelnetIO.readNEVariables()` (TelnetIO.java:1127-1180) processes incoming NEW-ENVIRON variable pairs in a loop and stores each pair in a `HashMap` held by `ConnectionData`: ```java // TelnetIO.java:1139-1178 boolean cont = true; if (i == NE_VAR || i == NE_USERVAR) { do { switch (readNEVariableName(sbuf)) { case NE_VAR_OK: TelnetIO.this.connectionData.getEnvironment().put(str, sbuf.toString()); // ← no per-connection count limit break; case NE_VAR_UNDEFINED: break; // cont remains true, loop continues } } while (cont); // cont is never set to false; only exits via return } ``` The variable accumulator map is a plain `HashMap` initialized with capacity 20 and **no maximum size**: ```java // ConnectionData.java:98 environment = new HashMap<String, String>(20); ``` Per-variable limits exist (name: max 50 chars, value: max 1000 chars), but there is no cap on the *count* of variables. Each map entry occupies approximately 2 KB of heap (String headers + `Map.Entry` + backing char arrays). On a JVM with a 512 MB heap, approximately 250,000 unique entries trigger an `OutOfMemoryError`. Network cost: using sequential 1-byte names (e.g., `\x01`, `\x02`, ...) and 1-byte values, each variable pair requires roughly 13 protocol bytes. Sending 250,000 pairs requires only ~3.25 MB of network traffic — feasible in seconds over any reasonable network connection. No authentication is required. NEW-ENVIRON negotiation occurs before login. Affected source files: - `remote-telnet/src/main/java/org/jline/builtins/telnet/TelnetIO.java` lines 1127-1180 - `remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java` line 98 ### PoC Connect to the JLine3 Telnet server and, after completing WILL/DO option negotiation, send a NEW-ENVIRON SEND subneg followed by a single large IS subneg containing thousands of unique variable pairs before the final IAC SE. Protocol structure (no authentication required): 1. Standard Telnet option negotiation (IAC DO NEW-ENVIRON, IAC WILL NEW-ENVIRON) 2. Server sends IAC SB NEW-ENVIRON SEND IAC SE 3. Client responds with: IAC SB NEW-ENVIRON IS [NE_VAR 0x01 NE_VALUE 0x01] ← variable pair 1 [NE_VAR 0x02 NE_VALUE 0x01] ← variable pair 2 ... repeated N times ... IAC SE ← only sent after N pairs Each iteration adds one entry to the per-connection environment map. The connection thread blocks reading from the socket while accumulating pairs, so the attacker controls the timing of the OOM. Reproduction environment: - JLine3 built from current master on x86_64 Linux, OpenJDK 25.0.2 - `remote-telnet` module started with its default configuration - Confirmed by source-code analysis; loop exit condition and missing count guard verified by inspection of `readNEVariables()` and `ConnectionData` constructor ### Impact **Type**: Denial of Service (heap memory exhaustion / OutOfMemoryError) **Who is affected**: Any application embedding the JLine3 `remote-telnet` module and exposing its Telnet server. No credentials are required. A single connection can exhaust the entire JVM heap, crashing the host process or triggering JVM out-of-memory handling that impacts all users sharing that JVM instance. ### Credits This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.

CVSS v3.1

Score 7.5high

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

Affected software

jline

jline3

Affected versions
<3.30.14>=4.0.0 <4.0.16>=4.1.0 <4.2.1
org.jline/jline3
pkg:maven/org.jline/jline3
Affected versions
<3.30.14>=3.0.0 <3.30.14<4.0.16 >=4.0.0<4.2.1 >=4.2.0

Run on your own infrastructure? Check whether these packages are installed with threat-finder — our free open-source scanner.

AI-Powered Analysis

Machine-generated threat intelligence

AILast updated: 07/25/2026, 22:52:51 UTC

Technical Analysis

CVE-2026-56740 is an uncontrolled resource consumption vulnerability (CWE-400) in the JLine3 Telnet server remote-telnet module. The vulnerability arises because the TelnetIO.readNEVariables() method does not limit the number of environment variables a client can inject via the Telnet NEW-ENVIRON option. Each variable pair is stored in a HashMap within ConnectionData, allowing an unauthenticated attacker to flood the server with unique variable pairs before the terminating IAC SE byte, leading to JVM heap exhaustion and an OutOfMemoryError. This vulnerability affects versions prior to 3.30.14, 4.0.16, and 4.2.1, where it has been fixed.

Potential Impact

An unauthenticated remote attacker can cause a denial of service by exhausting the JVM heap memory of the JLine3 Telnet server through injection of excessive environment variables. This results in an OutOfMemoryError, disrupting service availability. There is no impact on confidentiality or integrity according to the CVSS vector.

Mitigation Recommendations

Upgrade affected JLine3 versions to 3.30.14, 4.0.16, or 4.2.1 or later, where this vulnerability has been fixed. No other mitigation or temporary workaround is indicated in the available data.

Pro Console: star threats, build custom feeds, automate alerts via Slack, email & webhooks.Upgrade to Pro

Technical Details

Data Version
5.2
Assigner Short Name
GitHub_M
Date Reserved
2026-06-22T19:17:28.959Z
Cvss Version
3.1
State
PUBLISHED

Threat ID: 6a5b401834329bf928c7134a

Added to database: 07/18/2026, 08:58:00 UTC

Last enriched: 07/25/2026, 22:52:51 UTC

Last updated: 10/16/2026, 06:48:17 UTC

Views: 206

Community Reviews

0 reviews

Crowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.

Sort by
Loading community insights…

Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.

Actions

PRO

Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.

Please log in to the Console to use AI analysis features.

Need more coverage?

Upgrade to Pro Console for AI refresh and higher limits.

For incident response and remediation, OffSeq services can help resolve threats faster.

Latest Threats

Breach by OffSeqOFFSEQFRIENDS — 25% OFF

Check if your credentials are on the dark web

Instant breach scanning across billions of leaked records. Free tier available.

Scan now
OffSeq TrainingCredly Certified

Lead Pen Test Professional

Technical5-day eLearningPECB Accredited
View courses