mediumCVSS 6.5Vulnerability

CVE-2026-77421

### Summary When regex search mode is enabled in the JLine3 `nano` editor, the user-supplied search term is compiled directly as a Java regular expression with no timeout or backtracking bound. A crafted pattern such as `(a+)+b` can hang the editor session thread at high CPU, causing a denial of service for that session. ### Details In `builtins/src/main/java/org/jline/builtins/Nano.java`, the search implementation uses `Pattern.LITERAL` only when regex mode is disabled. When regex mode is enabled, the search term is compiled as a raw Java regex: ```java Pattern pat = Pattern.compile( searchTerm, (searchCaseSensitive ? 0 : Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE) | (searchRegexp ? 0 : Pattern.LITERAL)); ``` This regex is then applied to buffer content. Because Java's regex engine is backtracking-based, nested-quantifier patterns can take exponential time on non-matching input. Affected source location: - `builtins/src/main/java/org/jline/builtins/Nano.java` - `doSearch(String text)` ### PoC 1. Create a file containing a long run of `a` characters and open it in the JLine3 `nano` editor. 2. Enable regex search mode with the editor's regex toggle. 3. Start a search and enter the pattern `(a+)+b`. Expected result: - The editor stops responding. - The session thread consumes high CPU. Reproduction environment: - JLine3 on x86_64 Linux - OpenJDK 25.0.2 ### Impact This is a denial-of-service vulnerability caused by catastrophic regex backtracking. Applications embedding `org.jline:jline-builtins` and exposing the `nano` editor are impacted. In local use, the user can hang their own session. In remote multi-user deployments, an attacker can occupy a server worker thread indefinitely. ### Suggested Fix The preferred fix for the current git head is to use a linear-time regex engine for regex search mode while preserving literal matching behavior when regex mode is off. Suggested patch: ```diff diff --git a/builtins/p

Properties

ghsa_id
GHSA-ph9c-7hw9-vhhw
severity
medium
summary
JLine: ReDoS in Nano Editor Regex Search Mode
cvss_score
6.5
cve_id
CVE-2026-77421
cvss_vector
CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
signal_observed_at
2026-09-23T22:45:22+00:00
is_ghsa_only
false
ghsa_published
2026-09-23T18:12:38Z
source_url
https://github.com/advisories/GHSA-ph9c-7hw9-vhhw
ghsa_updated
2026-09-23T18:12:39Z

Related Entities (4)

AFFECTS (1)

[Software]maven/org.jline:jline-builtins

HAS_WEAKNESS (1)

[Weakness]Inefficient Regular Expression Complexity

REPORTED_BY (1)

[Source]GitHub Advisory Database

VULNERABLE_TO (1)

[Software]maven/org.jline:jline-builtins

Explore deeper with Ninja Signal's threat intelligence graph

CVE-2026-77421 (CVSS 6.5) — Ninja Signal Threat Intelligence | Ninja Signal