7.5high
JLine: Unauthenticated Remote DoS via Unbounded Telnet NAWS Terminal Geometry
- Severity
- 7.5high CVSS:3.1 by GitHub_M
- Exploit likelihood
- 0.60% (higher than 49% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- GitHub_M
- Also known as
- GHSA-2r2c-cx56-8933
Description
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 apply an upper bound to terminal dimensions received via the Telnet NAWS option, and TelnetIO.handleNAWS() in TelnetIO.java:856-879 reads client-supplied width and height as 16-bit unsigned integers and passes values such as 65535x65535 to setTerminalGeometry(), allowing an unauthenticated remote attacker to repeatedly alternate values and trigger continuous expensive rendering work that causes CPU exhaustion and denial of service. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| jline jline3 | < 3.30.14, >= 4.0.0, < 4.0.16, >= 4.1.0, < 4.2.1 | CVE List |
| org.jline:jline-remote-telnet (Maven) | from 4.1.0 before 4.2.1, from 4.0.0 before 4.0.16, before 3.30.14 | GitHub Advisory Database |
| jline jline | before 3.30.14, from 4.0.0 before 4.0.16, from 4.1.0 before 4.2.1 | NVD |
All scores
| GitHub_M | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
| GitHub | 7.5high CVSS:3.1 | CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H |
Classification
SSVC (CISA-ADP): exploitation poc, automatable yes, technical impact partial.
What each source says
CVE List
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 apply an upper bound to terminal dimensions received via the Telnet NAWS option, and TelnetIO.handleNAWS() in TelnetIO.java:856-879 reads client-supplied width and height as 16-bit unsigned integers and passes values such as 65535x65535 to setTerminalGeometry(), allowing an unauthenticated remote attacker to repeatedly alternate values and trigger continuous expensive rendering work that causes CPU exhaustion and denial of service. This issue is fixed in versions 3.30.14, 4.0.16, and 4.2.1.
GitHub Advisory Database
Summary
The JLine3 Telnet server (remote-telnet module) does not apply an upper bound to
terminal dimensions received via the Telnet NAWS (Negotiate About Window Size) option.
An unauthenticated remote attacker can send a NAWS subnegotiation advertising a
65535×65535 terminal and repeatedly alternate values to trigger continuous, expensive
rendering work on the server, causing CPU exhaustion and denial of service.
Details
TelnetIO.handleNAWS() (TelnetIO.java:856-879) reads the client-supplied width and
height as 16-bit unsigned integers and passes them to setTerminalGeometry():
// TelnetIO.java:869-875
private void setTerminalGeometry(int columns, int rows) {
if (columns < SMALLEST_BELIEVABLE_WIDTH) columns = DEFAULT_WIDTH; // lower bound only
if (rows < SMALLEST_BELIEVABLE_HEIGHT) rows = DEFAULT_HEIGHT;
connectionData.setTerminalGeometry(columns, rows);
connection.processConnectionEvent(
new ConnectionEvent(connection, ConnectionEvent.Type.CONNECTION_TERMINAL_GEOMETRY_CHANGED));
}
Only a lower bound is enforced (minimum 20 columns / 6 rows). Values up to 65535 are accepted and stored. The geometry change event propagates to Telnet.java:153-158 where it calls:
terminal.setSize(new Size(65535, 65535));
terminal.raise(Signal.WINCH);
The WINCH signal triggers LineReaderImpl.handleSignal() → redisplay(). Inside
redisplay(), multiple paths iterate up to size.getColumns() times:
freshLine()(LineReaderImpl.java:937,953): loopssize.getColumns()-1= 65534 iterations, building and writing a space-padding string across the network socket.columnSplitLength(terminal, size.getColumns(), ...): called multiple times, each processing all characters against the 65535-wide line width.
Because WINCH only fires on change, the attacker alternates between two large values (e.g., 65535 and 65534) to trigger an unlimited stream of expensive render cycles. No authentication is required; the NAWS option is negotiated before any login sequence.
Affected source files:
remote-telnet/src/main/java/org/jline/builtins/telnet/TelnetIO.javalines 856-879remote-telnet/src/main/java/org/jline/builtins/telnet/Telnet.javalines 140-175reader/src/main/java/org/jline/reader/impl/LineReaderImpl.javalines 929-962, 1293-1313
PoC
Send the following two raw Telnet packets in a loop to a running JLine Telnet server. No login or authentication is required.
Packet 1 — NAWS 65535 × 65535: FF FA 1F FF FF FF FF FF F0 (IAC SB NAWS 0xFF 0xFF 0xFF 0xFF IAC SE)
Packet 2 — NAWS 65534 × 65534: FF FA 1F FF FE FF FE FF F0 (IAC SB NAWS 0xFF 0xFE 0xFF 0xFE IAC SE)
Sending these alternately at ~10 packets/second is sufficient to peg one CPU core on the server. The server remains in this state for as long as the connection is open.
Reproduction environment:
- JLine3 built from current master on x86_64 Linux, OpenJDK 25.0.2
remote-telnetmodule started with its defaultTelnetserver configuration- Test confirmed by source-code analysis and tracing the call chain at runtime
Impact
Type: Denial of Service (CPU exhaustion)
Who is affected: Any application that embeds the JLine3 remote-telnet module and
exposes its Telnet server on a network interface. The attacker requires no credentials.
A single connection making ~10 alternating NAWS packets per second fully occupies the
connection-handling thread and produces continuous I/O on the server's output stream.
Because connection threads are re-used for the life of the session, one attacker per
available connection slot can deny service to all users of that slot.
Credits
This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.
NVD (es)
JLine es una biblioteca Java para manejar la entrada de consola. Antes de las versiones 3.30.14, 4.0.16 y 4.2.1, el módulo remote-telnet del servidor Telnet de JLine3 no aplica un límite superior a las dimensiones del terminal recibidas a través de la opción Telnet NAWS, y TelnetIO.handleNAWS() en TelnetIO.java:856-879 lee el ancho y alto proporcionados por el cliente como enteros sin signo de 16 bits y pasa valores como 65535x65535 a setTerminalGeometry(), permitiendo a un atacante remoto no autenticado alternar repetidamente los valores y desencadenar un trabajo de renderizado costoso y continuo que causa el agotamiento de la CPU y la denegación de servicio. Este problema se ha solucionado en las versiones 3.30.14, 4.0.16 y 4.2.1.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-56741 changed 2026-07-20 | CVE Terms of Use |
| GitHub Advisory Database | GHSA-2r2c-cx56-8933 changed 2026-09-10 | CC-BY-4.0 |
| NVD | CVE-2026-56741 changed 2026-10-24 | Public domain |