{"id":"CVE-2026-77421","aliases":["DEBIAN-CVE-2026-77421","EUVD-2026-85522","GHSA-ph9c-7hw9-vhhw","UBUNTU-CVE-2026-77421"],"status":"published","title":"JLine: ReDoS in Nano Editor Regex Search Mode","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","severity":{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-11","score":0.00434,"percentile":0.38122,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-1333"],"published":"2026-09-23T18:07:21Z","modified":"2026-10-28T11:00:36Z","fixes":[{"ecosystem":"Maven","package":"org.jline:jline-builtins","fixed_in":["4.3.1","3.30.15"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Maven","package":"org.jline:jline-builtins","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.3.1"}]}]},{"source":"ghsa","ecosystem":"Maven","package":"org.jline:jline-builtins","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.30.15"}]}]},{"source":"osv","ecosystem":"Debian:12","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-3","3.3.1-4","3.3.1-5"]},{"source":"osv","ecosystem":"Debian:13","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-4","3.3.1-5"]},{"source":"osv","ecosystem":"Debian:14","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-4","3.3.1-5"]},{"source":"osv","ecosystem":"Maven","package":"org.jline:jline-builtins","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"4.0.0"},{"fixed":"4.3.1"}]}],"versions":["4.0.0","4.0.10","4.0.11","4.0.12","4.0.13","4.0.14","4.0.15","4.0.16","4.0.2","4.0.3","4.0.4","4.0.5","4.0.6","4.0.7","4.0.8","4.0.9","4.1.0","4.1.1","4.1.2","4.1.3","4.2.0","4.2.1","4.3.0"]},{"source":"osv","ecosystem":"Maven","package":"org.jline:jline-builtins","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"3.0.0"},{"fixed":"3.30.15"}]}],"versions":["3.10.0","3.11.0","3.12.0","3.12.1","3.13.0","3.13.1","3.13.2","3.13.3","3.14.0","3.14.1","3.15.0","3.16.0","3.17.0","3.17.1","3.18.0","3.19.0","3.2.0","3.20.0","3.21.0","3.22.0","3.23.0","3.24.0","3.24.1","3.25.0","3.25.1","3.26.0","3.26.1","3.26.2","3.26.3","3.27.0","3.27.1","3.28.0","3.29.0","3.3.0","3.3.1","3.30.0","3.30.1","3.30.10","3.30.11","3.30.12","3.30.13","3.30.14","3.30.2","3.30.3","3.30.4","3.30.5","3.30.6","3.30.7","3.30.8","3.30.9","3.4.0","3.5.0","3.5.1","3.5.2","3.6.0","3.6.1","3.6.2","3.7.0","3.7.1","3.8.0","3.8.1","3.8.2","3.9.0"]},{"source":"osv","ecosystem":"Ubuntu:14.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-2"]},{"source":"osv","ecosystem":"Ubuntu:14.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.11-1","2.11-2"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-2"]},{"source":"osv","ecosystem":"Ubuntu:16.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.11-4"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-2"]},{"source":"osv","ecosystem":"Ubuntu:18.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.11-4","2.12.1-1","2.14.6-1"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-2"]},{"source":"osv","ecosystem":"Ubuntu:20.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.14.6-3"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-3"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.14.6-4"]},{"source":"osv","ecosystem":"Ubuntu:22.04:LTS","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-2"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-3"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.14.6-5"]},{"source":"osv","ecosystem":"Ubuntu:24.04:LTS","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-3","3.3.1-3ubuntu1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-3build1"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.14.6-6"]},{"source":"osv","ecosystem":"Ubuntu:26.10","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-4build1","3.3.1-5"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"jline","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["1.0-3","1.0-3build1"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"jline2","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["2.14.6-6"]},{"source":"osv","ecosystem":"Ubuntu:26.04:LTS","package":"jline3","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"}]}],"versions":["3.3.1-4","3.3.1-4build1"]}],"products":[{"vendor":"jline","product":"jline3"}],"references":[{"url":"https://github.com/jline/jline3/security/advisories/GHSA-ph9c-7hw9-vhhw","tags":["x_refsource_CONFIRM","advisory","web","report"]},{"url":"https://github.com/jline/jline3/pull/2012","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/jline/jline3/pull/2018","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/jline/jline3/commit/1d5fc3099e77938b971e197211cad2d4fbb17541","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/jline/jline3/commit/341ee69ccc57b7733c1b40d6993219b64b3206ae","tags":["x_refsource_MISC","fix","web","report"]},{"url":"https://github.com/jline/jline3/releases/tag/4.3.1","tags":["x_refsource_MISC","web","report"]},{"url":"https://github.com/jline/jline3/releases/tag/jline-3.30.15","tags":["x_refsource_MISC","web","report"]},{"url":"https://github.com/advisories/GHSA-ph9c-7hw9-vhhw"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/77xxx/CVE-2026-77421.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-77421","tags":["advisory"]},{"url":"https://security-tracker.debian.org/tracker/CVE-2026-77421","tags":["advisory"]},{"url":"https://github.com/jline/jline3","tags":["package"]},{"url":"https://ubuntu.com/security/CVE-2026-77421","tags":["report"]},{"url":"https://www.cve.org/CVERecord?id=CVE-2026-77421","tags":["report"]}],"sources":{"cve":[{"id":"CVE-2026-77421","title":"JLine: ReDoS in Nano Editor Regex Search Mode","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T18:07:21.134Z","modified":"2026-09-23T19:43:56.607Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"cna"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:20:15.712761Z"}],"euvd":[{"id":"EUVD-2026-85522","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T18:07:21Z","modified":"2026-09-23T19:43:56Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T17:27:59.820483Z"}],"ghsa":[{"id":"GHSA-ph9c-7hw9-vhhw","title":"JLine: ReDoS in Nano Editor Regex Search Mode","description":"### Summary\n\nWhen regex search mode is enabled in the JLine3 `nano` editor, the user-supplied\nsearch term is compiled directly as a Java regular expression with no timeout or\nbacktracking bound. A crafted pattern such as `(a+)+b` can hang the editor session\nthread at high CPU, causing a denial of service for that session.\n\n### Details\n\nIn `builtins/src/main/java/org/jline/builtins/Nano.java`, the search implementation\nuses `Pattern.LITERAL` only when regex mode is disabled. When regex mode is enabled,\nthe search term is compiled as a raw Java regex:\n\n```java\nPattern pat = Pattern.compile(\n        searchTerm,\n        (searchCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE)\n                | (searchRegexp ? 0 : Pattern.LITERAL));\n```\n\nThis regex is then applied to buffer content. Because Java's regex engine is\nbacktracking-based, nested-quantifier patterns can take exponential time on\nnon-matching input.\n\nAffected source location:\n- `builtins/src/main/java/org/jline/builtins/Nano.java`\n- `doSearch(String text)`\n\n### PoC\n\n1. Create a file containing a long run of `a` characters and open it in the JLine3\n   `nano` editor.\n2. Enable regex search mode with the editor's regex toggle.\n3. Start a search and enter the pattern `(a+)+b`.\n\nExpected result:\n- The editor stops responding.\n- The session thread consumes high CPU.\n\nReproduction environment:\n- JLine3 on x86_64 Linux\n- OpenJDK 25.0.2\n\n### Impact\n\nThis is a denial-of-service vulnerability caused by catastrophic regex backtracking.\nApplications embedding `org.jline:jline-builtins` and exposing the `nano` editor are\nimpacted. In local use, the user can hang their own session. In remote multi-user\ndeployments, an attacker can occupy a server worker thread indefinitely.\n\n### Suggested Fix\n\nThe preferred fix for the current git head is to use a linear-time regex engine for\nregex search mode while preserving literal matching behavior when regex mode is off.\n\nSuggested patch:\n\n```diff\ndiff --git a/builtins/pom.xml b/builtins/pom.xml\n--- a/builtins/pom.xml\n+++ b/builtins/pom.xml\n@@\n         \u003cdependency\u003e\n+            \u003cgroupId\u003ecom.google.re2j\u003c/groupId\u003e\n+            \u003cartifactId\u003ere2j\u003c/artifactId\u003e\n+            \u003cversion\u003e1.8\u003c/version\u003e\n+        \u003c/dependency\u003e\n+        \u003cdependency\u003e\n             \u003cgroupId\u003eorg.jline\u003c/groupId\u003e\n             \u003cartifactId\u003ejline-reader\u003c/artifactId\u003e\n         \u003c/dependency\u003e\n\ndiff --git a/builtins/src/main/java/org/jline/builtins/Nano.java b/builtins/src/main/java/org/jline/builtins/Nano.java\n--- a/builtins/src/main/java/org/jline/builtins/Nano.java\n+++ b/builtins/src/main/java/org/jline/builtins/Nano.java\n@@\n-import java.util.regex.Pattern;\n+import com.google.re2j.Pattern;\n```\n\nIf a dependency change is not acceptable, a fallback mitigation is to reject dangerous\nregex constructs or execute regex matching with a strict timeout, but that is weaker\nthan replacing the backtracking engine.\n\n### Credits\n\nThis issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.","status":"published","published":"2026-09-23T18:12:38Z","modified":"2026-09-23T18:12:39Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:41:20.575159Z"}],"nvd":[{"id":"CVE-2026-77421","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T19:19:15.7Z","modified":"2026-09-30T16:44:39.84Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium","assessor":"secondary"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T14:12:50.703874Z"}],"osv":[{"id":"CVE-2026-77421","title":"JLine: ReDoS in Nano Editor Regex Search Mode","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T18:07:21.134Z","modified":"2026-10-28T11:00:36.793272331Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T15:45:17.102988Z"},{"id":"DEBIAN-CVE-2026-77421","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T19:19:15.7Z","modified":"2026-10-01T08:47:35.795047078Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T15:46:03.502256Z"},{"id":"GHSA-ph9c-7hw9-vhhw","title":"JLine: ReDoS in Nano Editor Regex Search Mode","description":"### Summary\n\nWhen regex search mode is enabled in the JLine3 `nano` editor, the user-supplied\nsearch term is compiled directly as a Java regular expression with no timeout or\nbacktracking bound. A crafted pattern such as `(a+)+b` can hang the editor session\nthread at high CPU, causing a denial of service for that session.\n\n### Details\n\nIn `builtins/src/main/java/org/jline/builtins/Nano.java`, the search implementation\nuses `Pattern.LITERAL` only when regex mode is disabled. When regex mode is enabled,\nthe search term is compiled as a raw Java regex:\n\n```java\nPattern pat = Pattern.compile(\n        searchTerm,\n        (searchCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE)\n                | (searchRegexp ? 0 : Pattern.LITERAL));\n```\n\nThis regex is then applied to buffer content. Because Java's regex engine is\nbacktracking-based, nested-quantifier patterns can take exponential time on\nnon-matching input.\n\nAffected source location:\n- `builtins/src/main/java/org/jline/builtins/Nano.java`\n- `doSearch(String text)`\n\n### PoC\n\n1. Create a file containing a long run of `a` characters and open it in the JLine3\n   `nano` editor.\n2. Enable regex search mode with the editor's regex toggle.\n3. Start a search and enter the pattern `(a+)+b`.\n\nExpected result:\n- The editor stops responding.\n- The session thread consumes high CPU.\n\nReproduction environment:\n- JLine3 on x86_64 Linux\n- OpenJDK 25.0.2\n\n### Impact\n\nThis is a denial-of-service vulnerability caused by catastrophic regex backtracking.\nApplications embedding `org.jline:jline-builtins` and exposing the `nano` editor are\nimpacted. In local use, the user can hang their own session. In remote multi-user\ndeployments, an attacker can occupy a server worker thread indefinitely.\n\n### Suggested Fix\n\nThe preferred fix for the current git head is to use a linear-time regex engine for\nregex search mode while preserving literal matching behavior when regex mode is off.\n\nSuggested patch:\n\n```diff\ndiff --git a/builtins/pom.xml b/builtins/pom.xml\n--- a/builtins/pom.xml\n+++ b/builtins/pom.xml\n@@\n         \u003cdependency\u003e\n+            \u003cgroupId\u003ecom.google.re2j\u003c/groupId\u003e\n+            \u003cartifactId\u003ere2j\u003c/artifactId\u003e\n+            \u003cversion\u003e1.8\u003c/version\u003e\n+        \u003c/dependency\u003e\n+        \u003cdependency\u003e\n             \u003cgroupId\u003eorg.jline\u003c/groupId\u003e\n             \u003cartifactId\u003ejline-reader\u003c/artifactId\u003e\n         \u003c/dependency\u003e\n\ndiff --git a/builtins/src/main/java/org/jline/builtins/Nano.java b/builtins/src/main/java/org/jline/builtins/Nano.java\n--- a/builtins/src/main/java/org/jline/builtins/Nano.java\n+++ b/builtins/src/main/java/org/jline/builtins/Nano.java\n@@\n-import java.util.regex.Pattern;\n+import com.google.re2j.Pattern;\n```\n\nIf a dependency change is not acceptable, a fallback mitigation is to reject dangerous\nregex constructs or execute regex matching with a strict timeout, but that is weaker\nthan replacing the backtracking engine.\n\n### Credits\n\nThis issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.","status":"published","published":"2026-09-23T18:12:38Z","modified":"2026-09-23T18:27:57.317350405Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"cwes":["CWE-1333"],"updated_at":"2026-11-02T15:46:53.244788Z"},{"id":"UBUNTU-CVE-2026-77421","description":"JLine is a Java library for handling console input. From 3.0.0 until 3.30.15 and 4.3.1, the JLine built-in nano editor's regex search mode passes a user-controlled search term from doSearch(String text) in builtins/src/main/java/org/jline/builtins/Nano.java to Java's backtracking regular expression engine without a timeout or backtracking bound. A nested-quantifier expression evaluated against non-matching buffer content can consume excessive CPU and indefinitely block the editor session thread, and remote multi-user deployments can lose a worker thread for each affected session. This issue is fixed in versions 3.30.15 and 4.3.1.","status":"published","published":"2026-09-23T19:19:00Z","modified":"2026-10-17T13:01:08.105739863Z","cvss":[{"version":"3.1","score":6.5,"vector":"CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","level":"medium"}],"updated_at":"2026-11-02T16:57:18.015985Z"}]}}
