Every CVE Search/ Get API key

CVE-2026-56740

JLine: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables

7.5 HighFix available

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Attack profile

How easy it is to exploit

Attack vector
Network
Complexity
Low
Privileges needed
None
User interaction
None

What an attacker can affect

Confidentiality
None
Integrity
None
Availability
High

Exploit likelihood

0.59%Up 0.1 points since Jul 18, 2026
90%50%10%1%

What each source reports

CVE List Score used 7.5

JLine: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
CVE-2026-56740
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
EUVDEUVD-2026-45343 7.5

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
EUVD-2026-45343
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
GitHub AdvisoriesGHSA-47qp-hqvx-6r3f 7.5

JLine3 Telnet server: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables

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:

// 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:

// 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.

Record
GHSA-47qp-hqvx-6r3f
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
NVD 7.5

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
CVE-2026-56740
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSV 7.5

JLine: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
CVE-2026-56740
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSVDEBIAN-CVE-2026-56740 7.5

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
DEBIAN-CVE-2026-56740
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
Show 8 moreShow less
OSVGHSA-47qp-hqvx-6r3f 7.5

JLine3 Telnet server: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables

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:

// 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:

// 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.

Record
GHSA-47qp-hqvx-6r3f
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Weakness
CWE-400
Updated
2026-11-02
OSVUBUNTU-CVE-2026-56740 7.5

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
UBUNTU-CVE-2026-56740
CVSS 3.1
7.5 HighCVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
Updated
2026-11-02
OSVAZL-92450 No score

CVE-2026-56740 affecting package jline 2.14.6-1

JLine is a Java library for handling console input. Prior to 3.30.14, 4.0.16, and 4.2.1, 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, and TelnetIO.readNEVariables() in TelnetIO.java:1127-1180 stores each variable pair in a HashMap held by ConnectionData, allowing an unauthenticated attacker to flood unique variable pairs before the terminating IAC SE byte and exhaust JVM heap memory with an OutOfMemoryError. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.

Record
AZL-92450
Updated
2026-11-05
OSVopenSUSE-SU-2026:11338-1 No score

jline3-3.30.15-3.1 on GA media

These are all security issues fixed in the jline3-3.30.15-3.1 package on the GA media of openSUSE Tumbleweed.

Record
openSUSE-SU-2026:11338-1
Updated
2026-11-02
OSVopenSUSE-SU-2026:21423-1 No score

Security update for jline3

This update for jline3 fixes the following issues:

  • CVE-2026-56740: unauthenticated remote memory exhaustion via unbounded Telnet NEW-ENVIRON variables (bsc#1269021).
  • CVE-2026-56741: unauthenticated remote DoS via Unbounded Telnet NAWS Terminal Geometry (bsc#1270083).

Changes for jline3:

  • Update to upstream version 3.30.15
  • fix: guard regex matching against catastrophic backtracking (ReDoS) (#2018, backport of #2012):
    • Adds SafeRegex utility with TimeoutCharSequence to enforce wall-clock deadlines during regex matching
    • Fixes 8 locations across terminal, reader, and builtins where user-controlled input could trigger catastrophic backtracking
    • Addresses GHSA-r2xf-8xr9-62gw, GHSA-2v9w-34q6-wpqx, GHSA-ph9c-7hw9-vhhw, GHSA-5q95-hrpc-m3w3
  • fix: backport security hardening (#1986, #1995):
    • Create persisted history file with owner-only permissions
    • Use exclusive create for extracted native library temp files
  • fix: warn on insecure permissions when history file created concurrently
Record
openSUSE-SU-2026:21423-1
Updated
2026-11-02
OSVROOT-APP-MAVEN-CVE-2026-56740 No score

CVE-2026-56740 in org.jline:jline-remote-telnet - Patched by Root

Root has patched CVE-2026-56740 in the org.jline:jline-remote-telnet package for Root:Maven. Multiple fixed versions available.

Record
ROOT-APP-MAVEN-CVE-2026-56740
Updated
2026-11-02
OSVROOT-APP-MAVEN-GHSA-47qp-hqvx-6r3f No score

GHSA-47qp-hqvx-6r3f in org.jline:jline-remote-telnet - Patched by Root

Root has patched GHSA-47qp-hqvx-6r3f in the org.jline:jline-remote-telnet package for Root:Maven. Multiple fixed versions available.

Record
ROOT-APP-MAVEN-GHSA-47qp-hqvx-6r3f
Updated
2026-11-02
OSVSUSE-SU-2026:22856-1 No score

Security update for jline3

This update for jline3 fixes the following issues:

  • CVE-2026-56740: unauthenticated remote memory exhaustion via unbounded Telnet NEW-ENVIRON variables (bsc#1269021).
  • CVE-2026-56741: unauthenticated remote DoS via Unbounded Telnet NAWS Terminal Geometry (bsc#1270083).

Changes for jline3:

  • Update to upstream version 3.30.15
  • fix: guard regex matching against catastrophic backtracking (ReDoS) (#2018, backport of #2012):
    • Adds SafeRegex utility with TimeoutCharSequence to enforce wall-clock deadlines during regex matching
    • Fixes 8 locations across terminal, reader, and builtins where user-controlled input could trigger catastrophic backtracking
    • Addresses GHSA-r2xf-8xr9-62gw, GHSA-2v9w-34q6-wpqx, GHSA-ph9c-7hw9-vhhw, GHSA-5q95-hrpc-m3w3
  • fix: backport security hardening (#1986, #1995):
    • Create persisted history file with owner-only permissions
    • Use exclusive create for extracted native library temp files
  • fix: warn on insecure permissions when history file created concurrently
Record
SUSE-SU-2026:22856-1
Updated
2026-11-02

Affected products

Affected packages

Affected packages
PackageAffectedFixed
org.jline:jline-remote-telnet
Maven
4.1.0 up to 4.2.1
4.2.1
org.jline:jline-remote-telnet
Maven
4.0.0 up to 4.0.16
4.0.16
org.jline:jline-remote-telnet
Maven
before 3.30.14
3.30.14
jline
Azure Linux:3
through 2.14.6-1 None known
jline
Debian:12
All versions, plus listed versions
1.0-3
None known
jline
Debian:13
All versions, plus listed versions
1.0-3
None known
jline
Debian:14
All versions, plus listed versions
1.0-3
None known
jline2
Debian:12
All versions, plus listed versions
2.14.6-52.14.6-6
None known
jline2
Debian:13
All versions, plus listed versions
2.14.6-6
None known
jline2
Debian:14
All versions, plus listed versions
2.14.6-6
None known
Show 32 moreShow less
Affected packages
PackageAffectedFixed
jline3
Debian:12
All versions, plus listed versions
3.3.1-33.3.1-43.3.1-5
None known
jline3
Debian:13
All versions, plus listed versions
3.3.1-43.3.1-5
None known
jline3
Debian:14
All versions, plus listed versions
3.3.1-43.3.1-5
None known
org.jline:jline-remote-telnet
Maven
4.1.0 up to 4.2.1, plus listed versions
4.1.14.1.24.1.34.2.0
4.2.1
org.jline:jline-remote-telnet
Maven
4.0.0 up to 4.0.16, plus listed versions
4.0.104.0.114.0.124.0.134.0.14
Show 9 moreShow less
4.0.154.0.24.0.34.0.44.0.54.0.64.0.74.0.84.0.9
4.0.16
org.jline:jline-remote-telnet
Maven
before 3.30.14, plus listed versions
3.10.03.11.03.12.03.12.13.13.0
Show 45 moreShow less
3.13.13.13.23.13.33.14.03.14.13.15.03.16.03.17.03.17.13.18.03.19.03.2.03.20.03.21.03.22.03.23.03.24.03.24.13.25.03.25.13.26.03.26.13.26.23.26.33.27.03.27.13.28.03.29.03.3.03.3.13.30.03.30.13.30.103.30.113.30.123.30.133.30.23.30.33.30.43.30.53.30.63.30.73.30.83.30.93.4.0
3.30.14
org.jline:jline-remote-telnet
Root:Maven
before 3.25.1-aikido.2
3.25.1-aikido.23.25.1-aikido.33.25.1-aikido.43.25.1-aikido.1
io.root.org.jline:jline-remote-telnet
Root:Maven
before 3.25.1-root.io.2
3.25.1-root.io.23.25.1-root.io.33.25.1-root.io.43.25.1-root.io.1
jline3
SUSE:Linux Enterprise Server 16.0
From an advisory covering 2 CVEs
before 3.30.15-160000.1.1
3.30.15-160000.1.1
jline3
SUSE:Linux Enterprise Server for SAP applications 16.0
From an advisory covering 2 CVEs
before 3.30.15-160000.1.1
3.30.15-160000.1.1
jline
Ubuntu:14.04:LTS
All versions, plus listed versions
1.0-2
None known
jline2
Ubuntu:14.04:LTS
All versions, plus listed versions
2.11-12.11-2
None known
jline
Ubuntu:16.04:LTS
All versions, plus listed versions
1.0-2
None known
jline2
Ubuntu:16.04:LTS
All versions, plus listed versions
2.11-4
None known
jline
Ubuntu:18.04:LTS
All versions, plus listed versions
1.0-2
None known
jline2
Ubuntu:18.04:LTS
All versions, plus listed versions
2.11-42.12.1-12.14.6-1
None known
jline
Ubuntu:20.04:LTS
All versions, plus listed versions
1.0-2
None known
jline2
Ubuntu:20.04:LTS
All versions, plus listed versions
2.14.6-3
None known
jline
Ubuntu:22.04:LTS
All versions, plus listed versions
1.0-3
None known
jline2
Ubuntu:22.04:LTS
All versions, plus listed versions
2.14.6-4
None known
jline3
Ubuntu:22.04:LTS
All versions, plus listed versions
3.3.1-2
None known
jline
Ubuntu:24.04:LTS
All versions, plus listed versions
1.0-3
None known
jline2
Ubuntu:24.04:LTS
All versions, plus listed versions
2.14.6-5
None known
jline3
Ubuntu:24.04:LTS
All versions, plus listed versions
3.3.1-33.3.1-3ubuntu1
None known
jline
Ubuntu:26.10
All versions, plus listed versions
1.0-3build1
None known
jline2
Ubuntu:26.10
All versions, plus listed versions
2.14.6-6
None known
jline3
Ubuntu:26.10
All versions, plus listed versions
3.3.1-4build13.3.1-5
None known
jline
Ubuntu:26.04:LTS
All versions, plus listed versions
1.0-31.0-3build1
None known
jline2
Ubuntu:26.04:LTS
All versions, plus listed versions
2.14.6-6
None known
jline3
Ubuntu:26.04:LTS
All versions, plus listed versions
3.3.1-43.3.1-4build1
None known
jline3
openSUSE:Tumbleweed
From an advisory covering 2 CVEs
before 3.30.15-3.1
3.30.15-3.1
jline3
openSUSE:Leap 16.0
From an advisory covering 2 CVEs
before 3.30.15-160000.1.1
3.30.15-160000.1.1

History

History
RecordedChangedSources
affected
factsOSV
first indexedCVE List, EUVD, GitHub Advisories, NVD, OSV

Dates are when Every CVE recorded each change. Upstream dates may differ.

In short

CVE-2026-56740 is a high vulnerability (CVSS 7.5) in Jline, published June 18, 2026. No source lists public exploit code. EPSS puts the chance of exploitation in the next 30 days at 0.59%, the 48th percentile. Fixed in org.jline:jline-remote-telnet 4.2.1.

References

Show 15 moreShow less
This page doesn't list everything

Left out here: 12 versions. The JSON record has them.

MoveEnter Open