{"id":"CVE-2026-56741","aliases":["CVE-2026-56741","GHSA-2r2c-cx56-8933"],"related":[],"kind":"vulnerability","state":"published","title":"JLine: Unauthenticated Remote DoS via Unbounded Telnet NAWS Terminal Geometry","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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.","source":"cvelist"},{"lang":"en","text":"### Summary\n\nThe JLine3 Telnet server (`remote-telnet` module) does not apply an upper bound to\nterminal dimensions received via the Telnet NAWS (Negotiate About Window Size) option.\nAn unauthenticated remote attacker can send a NAWS subnegotiation advertising a\n65535×65535 terminal and repeatedly alternate values to trigger continuous, expensive\nrendering work on the server, causing CPU exhaustion and denial of service.\n\n### Details\n\n`TelnetIO.handleNAWS()` (TelnetIO.java:856-879) reads the client-supplied width and\nheight as 16-bit unsigned integers and passes them to `setTerminalGeometry()`:\n\n```java\n// TelnetIO.java:869-875\nprivate void setTerminalGeometry(int columns, int rows) {\n    if (columns < SMALLEST_BELIEVABLE_WIDTH) columns = DEFAULT_WIDTH;  // lower bound only\n    if (rows    < SMALLEST_BELIEVABLE_HEIGHT) rows    = DEFAULT_HEIGHT;\n    connectionData.setTerminalGeometry(columns, rows);\n    connection.processConnectionEvent(\n        new ConnectionEvent(connection, ConnectionEvent.Type.CONNECTION_TERMINAL_GEOMETRY_CHANGED));\n}\n```\n\nOnly a *lower* bound is enforced (minimum 20 columns / 6 rows). Values up to 65535 are\naccepted and stored. The geometry change event propagates to Telnet.java:153-158 where\nit calls:\n\n    terminal.setSize(new Size(65535, 65535));\n    terminal.raise(Signal.WINCH);\n\nThe WINCH signal triggers `LineReaderImpl.handleSignal()` → `redisplay()`. Inside\n`redisplay()`, multiple paths iterate up to `size.getColumns()` times:\n\n- `freshLine()` (LineReaderImpl.java:937,953): loops `size.getColumns()-1` = **65534\n  iterations**, building and writing a space-padding string across the network socket.\n- `columnSplitLength(terminal, size.getColumns(), ...)`: called multiple times,\n  each processing all characters against the 65535-wide line width.\n\nBecause WINCH only fires on *change*, the attacker alternates between two large values\n(e.g., 65535 and 65534) to trigger an unlimited stream of expensive render cycles.\nNo authentication is required; the NAWS option is negotiated before any login sequence.\n\nAffected source files:\n- `remote-telnet/src/main/java/org/jline/builtins/telnet/TelnetIO.java` lines 856-879\n- `remote-telnet/src/main/java/org/jline/builtins/telnet/Telnet.java` lines 140-175\n- `reader/src/main/java/org/jline/reader/impl/LineReaderImpl.java` lines 929-962, 1293-1313\n\n### PoC\n\nSend the following two raw Telnet packets in a loop to a running JLine Telnet server.\nNo login or authentication is required.\n\nPacket 1 — NAWS 65535 × 65535:\n  FF FA 1F FF FF FF FF FF F0\n  (IAC SB NAWS 0xFF 0xFF 0xFF 0xFF IAC SE)\n\nPacket 2 — NAWS 65534 × 65534:\n  FF FA 1F FF FE FF FE FF F0\n  (IAC SB NAWS 0xFF 0xFE 0xFF 0xFE IAC SE)\n\nSending these alternately at ~10 packets/second is sufficient to peg one CPU core on\nthe server. The server remains in this state for as long as the connection is open.\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 `Telnet` server configuration\n- Test confirmed by source-code analysis and tracing the call chain at runtime\n\n### Impact\n\n**Type**: Denial of Service (CPU exhaustion)\n**Who is affected**: Any application that embeds the JLine3 `remote-telnet` module and\nexposes its Telnet server on a network interface. The attacker requires no credentials.\nA single connection making ~10 alternating NAWS packets per second fully occupies the\nconnection-handling thread and produces continuous I/O on the server's output stream.\nBecause connection threads are re-used for the life of the session, one attacker per\navailable connection slot can deny service to all users of that slot.\n\n### Credits\nThis issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.","format":"markdown","source":"ghsa"},{"lang":"es","text":"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.","source":"nvd"}],"published":"2026-06-18T13:07:16.000Z","modified":"2026-10-24T20:10:00.137Z","severity":{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},"severities":[{"scorer":"GitHub_M","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"},{"scorer":"GitHub","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H","score":7.5,"rating":"HIGH"}],"cwes":["CWE-400"],"affected":[{"ranges":[{"version":"< 3.30.14","status":"affected"},{"version":">= 4.0.0, < 4.0.16","status":"affected"},{"version":">= 4.1.0, < 4.2.1","status":"affected"}],"vendor":"jline","product":"jline3","source":"cvelist"},{"ranges":[{"type":"ecosystem","introduced":"4.1.0","status":"affected","fixed":"4.2.1"}],"ecosystem":"Maven","package":"org.jline:jline-remote-telnet","purl":"pkg:maven/org.jline/jline-remote-telnet","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"4.0.0","status":"affected","fixed":"4.0.16"}],"ecosystem":"Maven","package":"org.jline:jline-remote-telnet","purl":"pkg:maven/org.jline/jline-remote-telnet","source":"ghsa"},{"ranges":[{"type":"ecosystem","introduced":"0","status":"affected","fixed":"3.30.14"}],"ecosystem":"Maven","package":"org.jline:jline-remote-telnet","purl":"pkg:maven/org.jline/jline-remote-telnet","source":"ghsa"},{"ranges":[{"status":"affected","fixed":"3.30.14"},{"status":"affected","introduced":"4.0.0","fixed":"4.0.16"},{"status":"affected","introduced":"4.1.0","fixed":"4.2.1"}],"vendor":"jline","product":"jline","cpe":"cpe:2.3:a:jline:jline:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://github.com/jline/jline3/security/advisories/GHSA-2r2c-cx56-8933","tags":["exploit","vendor-advisory","web","x-refsource-confirm"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/pull/2000","tags":["issue-tracking","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/commit/3ea9cad8699714dc072fade29d36be0d1e23d708","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/commit/733eb353dca7b0ea0252e724445b6defa29c393e","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/commit/86b7ba7801988aadb1a67555629522a71d603bd3","tags":["patch","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/releases/tag/4.0.16","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://github.com/jline/jline3/releases/tag/4.2.1","tags":["release-notes","web","x-refsource-misc"],"sources":["cvelist","ghsa","nvd"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-56741","tags":["advisory"],"sources":["ghsa"]},{"url":"https://github.com/jline/jline3","tags":["package"],"sources":["ghsa"]}],"credits":[],"assigner":"GitHub_M","ssvc":{"scorer":"CISA-ADP","exploitation":"poc","automatable":"yes","technicalImpact":"partial","date":"2026-07-20T15:21:00.621Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-56741","url":"https://www.cve.org/CVERecord?id=CVE-2026-56741","licence":"CVE Terms of Use","modified":"2026-07-20T15:21:23.382Z"},{"source":"ghsa","name":"GitHub Advisory Database","id":"GHSA-2r2c-cx56-8933","url":"https://github.com/advisories/GHSA-2r2c-cx56-8933","licence":"CC-BY-4.0","modified":"2026-09-10T03:51:07.726Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-56741","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-56741","licence":"Public domain","modified":"2026-10-24T20:10:00.137Z"}],"updatedAt":"2026-11-25T22:59:28.595Z","epss":{"score":0.00595,"percentile":0.49817,"date":"2026-12-01T12:00:22.000Z"}}