Vulnerabilities in pkg:maven/org.jline/jline-remote-telnet

PACKAGE
Advisory Identifier: GHSA-47qp-hqvx-6r3f
Advisory Summary

CVE-2026-56740 is a HIGH (CVSS 7.5) unauthenticated remote memory exhaustion vulnerability (CWE-400: Uncontrolled Resource Consumption) affecting JLine3 Telnet server libraries in the Maven ecosystem. The issue involves unauthenticated remote memory exhaustion via unbounded telnet new-environ variables. Remediation is available by upgrading affected packages to version 4.2.1, 4.0.16, 3.30.14.

2 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.jline/jline-remote-telnet

2 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.jline/jline-remote-telnet. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-47qp-hqvx-6r3f CVE-2026-56740 HIGH JLine3 Telnet server: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables
GHSA-2r2c-cx56-8933 CVE-2026-56741 HIGH JLine3 Telnet server: Unauthenticated Remote DoS via Unbounded Telnet NAWS Terminal Geometry

CVE-2026-56740 at a Glance

CVE Identifier CVE-2026-56740
GHSA Identifier GHSA-47qp-hqvx-6r3f
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-400: Uncontrolled Resource Consumption
Affected Product JLine3 Telnet server
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

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

How to Fix CVE-2026-56740

To remediate this vulnerability, upgrade all affected JLine3 Telnet server dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.jline:jline-remote-telnet fixed: 4.2.1
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-remote-telnet</artifactId>
    <version>4.2.1</version>
</dependency>
org.jline:jline-remote-telnet fixed: 4.0.16
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-remote-telnet</artifactId>
    <version>4.0.16</version>
</dependency>
org.jline:jline-remote-telnet fixed: 3.30.14
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-remote-telnet</artifactId>
    <version>3.30.14</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.jline

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-56740, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.jline

Analyze the terminal output to locate any version of JLine3 Telnet server in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.2.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.jline command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-400: Uncontrolled Resource Consumption, where the product does not properly control the allocation and maintenance of a limited resource. In JLine3 Telnet server, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

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

CVE-2026-56740 Affected JLine3 Telnet server Versions

3 component(s)
Fixed Versions:
4.2.14.0.163.30.14
Product / Package Ecosystem Affected Versions Fixed Version
org.jline:jline-remote-telnet
Maven
≥ 4.1.0
< 4.2.1
4.2.1
org.jline:jline-remote-telnet
Maven
≥ 4.0.0
< 4.0.16
4.0.16
org.jline:jline-remote-telnet
Maven
< 3.30.14
3.30.14

References

Frequently Asked Questions

What is CVE-2026-56740?
CVE-2026-56740 is a security vulnerability in JLine3 Telnet server involving Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables under CWE-400: Uncontrolled Resource Consumption.
Which JLine3 Telnet server versions are affected?
Affected versions include releases prior to 4.2.1, 4.0.16, 3.30.14 across affected packages: org.jline:jline-remote-telnet.
What version fixes CVE-2026-56740?
Upgrading to 4.2.1, 4.0.16, 3.30.14 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jline-remote-telnet affected?
Yes, org.jline:jline-remote-telnet is affected in releases prior to 4.2.1, 4.0.16, 3.30.14. Upgrade your dependency to 4.2.1, 4.0.16, 3.30.14 or later.
What is the CVSS score of CVE-2026-56740?
CVE-2026-56740 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-56740?
CVE-2026-56740 is classified under CWE-400: Uncontrolled Resource Consumption (The product does not properly control the allocation and maintenance of a limited resource.).
How can I check Maven dependencies for CVE-2026-56740?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.jline'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-47qp-hqvx-6r3f",
  "modified" : "2026-09-01T21:03:11Z",
  "published" : "2026-06-18T13:07:25Z",
  "aliases" : [ "CVE-2026-56740" ],
  "summary" : "JLine3 Telnet server: Unauthenticated Remote Memory Exhaustion via Unbounded Telnet NEW-ENVIRON Variables",
  "details" : "### Summary\n\nThe JLine3 Telnet server (`remote-telnet` module) does not limit the number of\nenvironment variables a client may inject via the Telnet NEW-ENVIRON option. An\nunauthenticated attacker can flood the server with a large number of unique\nvariable pairs before sending the terminating IAC SE byte, exhausting JVM heap\nmemory and causing an OutOfMemoryError (denial of service). Approximately 3–4 MB of\nnetwork traffic is sufficient to consume a 512 MB JVM heap.\n\n### Details\n\n`TelnetIO.readNEVariables()` (TelnetIO.java:1127-1180) processes incoming NEW-ENVIRON\nvariable pairs in a loop and stores each pair in a `HashMap` held by `ConnectionData`:\n\n```java\n// TelnetIO.java:1139-1178\nboolean cont = true;\nif (i == NE_VAR || i == NE_USERVAR) {\n    do {\n        switch (readNEVariableName(sbuf)) {\n            case NE_VAR_OK:\n                TelnetIO.this.connectionData.getEnvironment().put(str, sbuf.toString());\n                // ← no per-connection count limit\n                break;\n            case NE_VAR_UNDEFINED:\n                break; // cont remains true, loop continues\n        }\n    } while (cont);  // cont is never set to false; only exits via return\n}\n```\n\nThe variable accumulator map is a plain `HashMap` initialized with capacity 20 and\n**no maximum size**:\n\n```java\n// ConnectionData.java:98\nenvironment = new HashMap<String, String>(20);\n```\n\nPer-variable limits exist (name: max 50 chars, value: max 1000 chars), but there is no\ncap on the *count* of variables. Each map entry occupies approximately 2 KB of heap\n(String headers + `Map.Entry` + backing char arrays). On a JVM with a 512 MB heap,\napproximately 250,000 unique entries trigger an `OutOfMemoryError`.\n\nNetwork cost: using sequential 1-byte names (e.g., `\\x01`, `\\x02`, ...) and 1-byte\nvalues, each variable pair requires roughly 13 protocol bytes. Sending 250,000 pairs\nrequires only ~3.25 MB of network traffic — feasible in seconds over any reasonable\nnetwork connection.\n\nNo authentication is required. NEW-ENVIRON negotiation occurs before login.\n\nAffected source files:\n- `remote-telnet/src/main/java/org/jline/builtins/telnet/TelnetIO.java` lines 1127-1180\n- `remote-telnet/src/main/java/org/jline/builtins/telnet/ConnectionData.java` line 98\n\n### PoC\n\nConnect to the JLine3 Telnet server and, after completing WILL/DO option negotiation,\nsend a NEW-ENVIRON SEND subneg followed by a single large IS subneg containing\nthousands of unique variable pairs before the final IAC SE.\n\nProtocol structure (no authentication required):\n1. Standard Telnet option negotiation (IAC DO NEW-ENVIRON, IAC WILL NEW-ENVIRON)\n2. Server sends IAC SB NEW-ENVIRON SEND IAC SE\n3. Client responds with: IAC SB NEW-ENVIRON IS\n     [NE_VAR 0x01 NE_VALUE 0x01]  ← variable pair 1\n     [NE_VAR 0x02 NE_VALUE 0x01]  ← variable pair 2\n     ... repeated N times ...\n     IAC SE                        ← only sent after N pairs\n\nEach iteration adds one entry to the per-connection environment map. The connection\nthread blocks reading from the socket while accumulating pairs, so the attacker\ncontrols the timing of the OOM.\n\nReproduction environment:\n- JLine3 built from current master on x86_64 Linux, OpenJDK 25.0.2\n- `remote-telnet` module started with its default configuration\n- Confirmed by source-code analysis; loop exit condition and missing count guard\n  verified by inspection of `readNEVariables()` and `ConnectionData` constructor\n\n### Impact\n\n**Type**: Denial of Service (heap memory exhaustion / OutOfMemoryError)\n**Who is affected**: Any application embedding the JLine3 `remote-telnet` module and\nexposing its Telnet server. No credentials are required. A single connection can exhaust\nthe entire JVM heap, crashing the host process or triggering JVM out-of-memory\nhandling that impacts all users sharing that JVM instance.\n\n### Credits \n\nThis issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-remote-telnet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.1.0"
      }, {
        "fixed" : "4.2.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-remote-telnet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.0.16"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-remote-telnet"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.30.14"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/security/advisories/GHSA-47qp-hqvx-6r3f"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-56740"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/pull/2000"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/pull/2001"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/commit/0389f0ee6d0375901b602671ad5dafd4d1d4ee09"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/commit/4ee3a73849ffb9a85ec748e4e8cd8f6d81f84f40"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/commit/934f09e6128cee33c2b13d42b6e859c1ee2d194b"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jline/jline3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/releases/tag/4.0.16"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/releases/tag/4.2.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/releases/tag/jline-3.30.14"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-400" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-18T13:07:25Z",
    "nvd_published_at" : "2026-07-17T22:17:57Z"
  }
}