Nov 24, 2026·10 min read·2 visits
JLine versions 3.0.0 through 3.30.14 and 4.0.0 through 4.3.0 contain a Regular Expression Denial of Service (ReDoS) vulnerability in the built-in less command. User-supplied search patterns are compiled and executed via java.util.regex without execution time limits, allowing nested quantifier expressions to stall worker threads and exhaust server thread pools. Upgrade to JLine 3.30.15 or 4.3.1 to remediate.
CVE-2026-77423 is a Regular Expression Denial of Service (ReDoS) vulnerability in the built-in less viewer of the JLine Java library (versions 3.0.0 prior to 3.30.15, and 4.0.0 prior to 4.3.1). The org.jline.builtins.Less class passes user-supplied search and display-filter patterns directly to Java's standard backtracking regular expression engine without complexity validation or execution timeouts. An attacker with access to an interactive JLine session can submit patterns containing nested quantifiers, causing catastrophic backtracking that consumes 100% of a CPU core and blocks the session thread indefinitely. In network-facing deployments such as SSH or Telnet administration consoles, repeated exploitation across concurrent sessions can exhaust bounded worker thread pools and result in a complete denial of service.
JLine is a Java library designed for handling console input, cursor manipulation, command completion, and interactive command-line interfaces across Unix and Windows environments. It is widely integrated into enterprise Java shells, database clients, build tools, and remote administration consoles such as Apache Karaf and Apache Mina SSHD. In addition to core line-editing capabilities, the org.jline:jline-builtins module provides pure-Java implementations of standard POSIX terminal utilities, including an interactive file pager modeled after the Unix less utility (org.jline.builtins.Less).
Within org.jline.builtins.Less, interactive users can query and filter loaded document buffers using regular expressions. The pager supports forward search (/), backward search (?), and line display filtering (&). When a user enters a query under any of these modes, the method getPattern(boolean doDisplayPattern) captures the input string, which is subsequently compiled into a java.util.regex.Pattern object and evaluated against every line in the active document source.
In JLine versions 3.0.0 prior to 3.30.15 and 4.0.0 prior to 4.3.1, this regular expression compilation and evaluation occurs without structural inspection of the pattern or time constraints on the matching operation. This design flaw is classified under CWE-1333: Inefficient Regular Expression Complexity.
Because Java's java.util.regex package utilizes a backtracking Non-deterministic Finite Automaton (NFA) engine, supplying a maliciously constructed regular expression containing nested or overlapping quantifiers causes the matcher to enter catastrophic backtracking when evaluated against non-matching lines. In network-accessible CLI services hosted over SSH or Telnet, an attacker can trigger this condition across multiple connections to exhaust the host application's worker thread pool and deny service to legitimate users.
The root cause of CVE-2026-77423 lies in the unrestricted execution of user-controlled regular expressions against file content on the synchronous execution path of the terminal session thread. Unlike application logic where regular expressions are static and input strings are untrusted, an interactive pager treats the regular expression pattern itself as untrusted user input while the target character sequences are drawn from local files or command output buffers.
When an interactive user triggers a search or display filter in org.jline.builtins.Less, the user's raw keystrokes are accumulated by getPattern(boolean doDisplayPattern). The resulting pattern string is compiled directly via Pattern.compile(pattern). The compiled Pattern instance is then passed into three primary line-scanning methods within Less.java: moveToNextMatch(boolean spanFiles) for forward navigation, moveToPreviousMatch(boolean spanFiles) for backward navigation, and toBeDisplayed(AttributedString curLine, Pattern dpCompiled) for rendering filtered buffers.
In each of these methods, the vulnerable code invokes compiled.matcher(line).find() or dpCompiled.matcher(curLine).find() directly inside a loop iterating over lines of the document. Java's java.util.regex.Matcher evaluates patterns using a recursive depth-first backtracking algorithm. When a pattern features ambiguous sub-expressions with nested unbounded quantifiers—such as (a+)+$ or ([a-zA-Z]+)*$—the NFA engine constructs an execution tree where the number of possible transition paths grows exponentially ($O(2^n)$) relative to the length $n$ of a non-matching input sequence.
Because Matcher.find() executes synchronously and checks neither thread interruption flags nor wall-clock execution deadlines by default, the thread executing the JLine Less command enters a CPU-bound loop. If a single line in the viewed file contains 30 to 40 contiguous characters that match the inner quantifier token but fail the terminal anchor or character check, the matcher explores billions of backtracking permutations before returning false, effectively hanging the thread indefinitely.
Before the patch, builtins/src/main/java/org/jline/builtins/Less.java invoked java.util.regex.Pattern.matcher(CharSequence).find() directly in three separate locations during buffer traversal. When iterating forward through lines in moveToNextMatch, backward in moveToPreviousMatch, or checking visibility predicates in toBeDisplayed, the application passed AttributedString line objects straight to the standard regex matcher.
--- a/builtins/src/main/java/org/jline/builtins/Less.java
+++ b/builtins/src/main/java/org/jline/builtins/Less.java
@@ -41,6 +41,7 @@
import org.jline.utils.Display;
import org.jline.utils.InfoCmp.Capability;
import org.jline.utils.NonBlockingReader;
+import org.jline.utils.SafeRegex;
import org.jline.utils.Status;
@@ -1103,7 +1104,7 @@ private void moveToNextMatch(boolean spanFiles) throws IOException {
break;
} else if (!toBeDisplayed(line, dpCompiled)) {
continue;
- } else if (compiled.matcher(line).find()) {
+ } else if (SafeRegex.find(compiled, line)) {
display.clear();
firstLineToDisplay = lineNumber;
offsetInLine = 0;
@@ -1143,7 +1144,7 @@ private void moveToPreviousMatch(boolean spanFiles) throws IOException {
break;
} else if (!toBeDisplayed(line, dpCompiled)) {
continue;
- } else if (compiled.matcher(line).find()) {
+ } else if (SafeRegex.find(compiled, line)) {
display.clear();
firstLineToDisplay = lineNumber;
offsetInLine = 0;
@@ -1317,10 +1318,7 @@ private Pair<Integer, AttributedString> prevLine2display(int line, Pattern dpCom
}
private boolean toBeDisplayed(AttributedString curLine, Pattern dpCompiled) {
- return curLine == null
- || dpCompiled == null
- || sourceIdx == 0
- || dpCompiled.matcher(curLine).find();
+ return curLine == null || dpCompiled == null || sourceIdx == 0 || SafeRegex.find(dpCompiled, curLine);
}To remediate the vulnerability without replacing the standard Java regex engine or restricting valid regular expression syntax, the JLine maintainers introduced org.jline.utils.SafeRegex in commit 1d5fc3099e77938b971e197211cad2d4fbb17541 (and backported it to the 3.x branch in commit 341ee69ccc57b7733c1b40d6993219b64b3206ae). SafeRegex wraps the target CharSequence inside a custom inner class named TimeoutCharSequence before passing it to Pattern.matcher().
// Key excerpt from org.jline.utils.SafeRegex
public final class SafeRegex {
private static final long DEFAULT_TIMEOUT_MS = 1500;
private static final int CHECK_INTERVAL = 1024;
public static boolean find(Pattern pattern, CharSequence input) {
try {
// Wraps input in TimeoutCharSequence with a 1500ms budget
return matcher(pattern, input).find();
} catch (RegexTimeoutException e) {
// Catches runaway backtracking and treats it as a non-match
return false;
}
}
private static final class TimeoutCharSequence implements CharSequence {
private final CharSequence inner;
private final long timeoutNanos;
private final long[] sharedDeadline;
private int calls;
@Override
public char charAt(int index) {
// Poll System.nanoTime() once every 1024 character accesses
if (++calls % CHECK_INTERVAL == 0) {
long now = System.nanoTime();
if (sharedDeadline[0] == 0) {
sharedDeadline[0] = now + timeoutNanos;
} else if (now > sharedDeadline[0]) {
throw new RegexTimeoutException();
}
}
return inner.charAt(index);
}
@Override
public CharSequence subSequence(int start, int end) {
// Preserve the sharedDeadline array across subSequence allocations
return new TimeoutCharSequence(inner.subSequence(start, end), timeoutNanos, sharedDeadline);
}
}
}Because java.util.regex.Matcher must repeatedly invoke CharSequence.charAt(int index) on the target string as it evaluates state transitions and backtracks, intercepting charAt() provides a deterministic hook into the regex engine's inner loop. To avoid the performance penalty of calling System.nanoTime() on every single character read, TimeoutCharSequence increments a counter (calls) and checks the clock every 1,024 invocations (CHECK_INTERVAL). Furthermore, subSequence() passes a reference to the single-element sharedDeadline array so that any sub-sequences sliced by the matcher share the original 1,500-millisecond wall-clock deadline.
> [!NOTE]
> Fix Completeness Assessment: The TimeoutCharSequence mechanism terminates catastrophic backtracking on any single line after 1,500 milliseconds and returns false. While this prevents an indefinite thread hang on a single find() call, Less evaluates SafeRegex.find() in a loop across every line in a file. If an attacker opens a file containing hundreds of non-matching lines and supplies a slow-backtracking pattern that takes 1,500 milliseconds per line to time out, the cumulative scan across all lines can still stall the session for an extended duration until the user interrupts the reader or all lines are processed.
Exploiting CVE-2026-77423 requires interactive access to a console or remote terminal interface powered by JLine where the built-in less command is registered and accessible. Common deployment targets include Java application servers, OSGi containers (such as Apache Karaf), and network-accessible SSH or Telnet administration shells built using JLine's Builtins or PosixCommands registries.
To trigger the vulnerability, an attacker first invokes the less command on any available non-empty file or pipes multi-line command output into less. The target document does not need to contain specially crafted content; standard log files, configuration files, or help documentation containing lines of 30 or more alphanumeric characters are sufficient to trigger exponential backtracking.
Once the less interactive viewer is active, the attacker presses / to initiate a forward search (or ? for reverse search, or & to apply a display filter). At the prompt, the attacker submits a regular expression containing nested quantifiers with an unreachable terminal condition:
/([a-zA-Z0-9_ ]+)+$Alternatively, if the file is known to contain repeated sequences of a specific character or word, a targeted polynomial or exponential expression can be used:
/((a+)+)+!When the attacker presses Enter, Less.getPattern() stores the expression and invokes moveToNextMatch() or toBeDisplayed(). As soon as the matcher encounters a line containing roughly 30 or more matching characters followed by a character that is not in the character class (for instance, a punctuation mark like . or : near the end of a log line when matching against ([a-zA-Z0-9_ ]+)+$), the NFA engine explores $2^n$ backtracking paths. The session becomes completely unresponsive, and the JVM thread assigned to the session consumes 100% of a logical CPU core. In an SSH or Telnet daemon with a fixed thread pool size (e.g., 10 to 50 worker threads), opening parallel sessions and repeating this keystroke sequence exhausts all available worker threads and prevents any new connections from being serviced.
CVE-2026-77423 carries a CVSS v3.1 base score of 7.5 (High) with the vector CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H. The vulnerability exclusively affects system availability (A:H) with no direct impact on confidentiality (C:N) or integrity (I:N). The Attack Vector is scored as Network (AV:N) because JLine's built-in commands are frequently exposed over network protocols via embedded SSH and Telnet servers.
The immediate impact of a single exploit attempt is the indefinite lockup of the calling Java thread and saturation of one CPU core. Because standard Java threads cannot be safely terminated mid-execution when stuck inside native or tight pure-Java loops without cooperative interruption checks, closing the client SSH or Telnet socket does not terminate the background Matcher.find() loop. The orphaned worker thread continues consuming 100% CPU in the background until the match space is exhausted or the JVM process is restarted.
In multi-user or multi-tenant server environments, the operational impact escalates from a single-session hang to a full application-level Denial of Service. Remote administration interfaces typically allocate a bounded ExecutorService or worker pool to service incoming shell sessions. An attacker who initiates $N$ concurrent connections—where $N$ equals the thread pool capacity or the number of physical CPU cores on the host—can starve the entire JVM of compute resources and exhaust the connection pool.
According to FIRST.org Exploit Prediction Scoring System (EPSS) metrics, CVE-2026-77423 holds an EPSS score of 0.00461 (0.461%, 40.76th percentile), indicating a low probability of mass automated exploitation in the wild. The vulnerability is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog, and no automated exploit kits or Nuclei templates currently target it.
The primary remediation for CVE-2026-77423 is to upgrade the JLine library dependencies (org.jline:jline, org.jline:jline-builtins, and associated artifacts) to a patched release. The vulnerability is patched in JLine 3.30.15 for the 3.x release branch and JLine 4.3.1 for the 4.x release branch. Both versions incorporate the org.jline.utils.SafeRegex wrapper across Less and other built-in utilities (which were simultaneously patched for related advisories GHSA-r2xf-8xr9-62gw, GHSA-ph9c-7hw9-vhhw, and GHSA-5q95-hrpc-m3w3).
For Maven-based projects on the 3.x branch, update the dependency version in pom.xml:
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-builtins</artifactId>
<version>3.30.15</version>
</dependency>For Maven-based projects on the 4.x branch, update the dependency version to 4.3.1:
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-builtins</artifactId>
<version>4.3.1</version>
</dependency>If an immediate library upgrade is not feasible due to dependency freezes or transitive compatibility constraints, administrators and developers should apply defense-in-depth mitigations:
less Command: In custom CLI implementations that register JLine built-ins programmatically, exclude Less from the registered command set or override the less command handler to disable interactive pattern searching.CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H| Product | Affected Versions | Fixed Version |
|---|---|---|
JLine (org.jline:jline / org.jline:jline-builtins) JLine | >= 3.0.0, < 3.30.15 | 3.30.15 |
JLine (org.jline:jline / org.jline:jline-builtins) JLine | >= 4.0.0, < 4.3.1 | 4.3.1 |
| Attribute | Detail |
|---|---|
| CVE ID | CVE-2026-77423 (GHSA-2v9w-34q6-wpqx) |
| Vulnerability Class | CWE-1333: Inefficient Regular Expression Complexity (ReDoS) |
| Affected Component | org.jline.builtins.Less (getPattern / moveToNextMatch / moveToPreviousMatch / toBeDisplayed) |
| CVSS v3.1 Score | 7.5 High (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H) |
| EPSS Score | 0.461% (40.76th Percentile) |
| Impact | 100% CPU thread utilization and worker thread pool exhaustion (Denial of Service) |
| Fixed Versions | JLine 3.30.15 and JLine 4.3.1 |
| CISA KEV Status | Not Listed |
The product uses a regular expression with an inefficient algorithmic complexity that can be exploited by providing malicious input strings or patterns that cause catastrophic backtracking, leading to denial of service.
CVE-2026-58262 (tracked internally as KLR-04 and via GitHub Security Advisory GHSA-f9h7-4mmq-vgcq) is a cryptographic verification and consensus quorum bypass vulnerability in Klever-Go (`klever-io/klever-go`), the Go implementation of the Klever blockchain protocol. Prior to version 1.7.20, the block header signature verification logic (`HeaderSigVerifier.verifyConsensusSize`) counts all set bits across the entire `PubKeysBitmap` byte slice toward the required two-thirds validator quorum without masking or validating unused trailing padding bits in the final byte. Because the underlying Boneh-Lynn-Shacham (BLS) multi-signature verification function (`blsMultiSigner.Verify`) iterates strictly over the indices of configured validator public keys, it ignores any bits set at indices beyond the active consensus group size. When the consensus group size is not an exact multiple of 8, a compromised or malicious block producer can set these unused trailing padding bits to artificially inflate the apparent signer count by up to 7 signatures, enabling blocks with fewer genuine validator signatures than required by the protocol to pass consensus validation.
CVE-2026-63492 is a rejected CVE identifier originally assigned by GitHub for an OS command injection vulnerability in WWBN AVideo (formerly YouPHPTube) up to version 29.0. It was rejected as a duplicate of the canonical identifier CVE-2026-63304 (tracked under GHSA-j44m-77cc-p3cc). The flaw resides in the listFFmpegProcesses() function within plugin/API/standAlone/functions.php, which interpolates unsanitized user parameters directly into a single-quoted shell pipeline executed via PHP's exec() function. Attackers capable of crafting a valid AES-256-CBC encrypted API payload can break out of the single-quoted context and execute arbitrary operating system commands as the web-server user.
CVE-2026-63476 is an uncontrolled resource consumption vulnerability in isomorphic-git prior to version 1.38.6. When parsing Git packfile delta objects during clone or fetch operations, the applyDelta utility reads an untrusted targetSize integer from the delta stream header and passes it directly to Buffer.alloc(). A malicious remote Git server or man-in-the-middle attacker can supply a delta header specifying a targetSize of approximately 2 GB with minimal actual payload data. Because Buffer.alloc() reserves off-heap memory in Node.js, this bypasses standard V8 heap limits and results in immediate out-of-memory termination or sustained memory retention.
CVE-2026-63410 (GHSA-vp2j-gqfm-r3cf) is a compiler-induced timing side-channel vulnerability in the secp256k1-native Ruby C extension. When compiled with GCC 14.x or 15.x at optimization level -O2, the compiler reconstructs boolean predicates from branchless bitwise multiplexer routines and emits secret-dependent conditional jump instructions (je/jne). During elliptic curve scalar multiplication in the Montgomery ladder, these conditional branches create observable execution timing variations correlated with individual bits of secret private keys or signing nonces.
CVE-2026-133469 is an improper authentication and input type validation vulnerability in the xo-server component of Vates Xen Orchestra and Xen Orchestra Appliance (XOA). Due to Express cookie-parser JSON deserialization combined with loose truthiness validation and unvalidated Redis query construction, an unauthenticated attacker can supply an empty JSON object cookie (authenticationToken=j:{}) to bypass authentication and hijack the first valid active session token stored in the database. This flaw is actively exploited in the wild to gain administrative control over Xen Orchestra deployments and execute root-level commands on underlying XCP-ng and XenServer hypervisors.
CVE-2026-22816 (GHSA-w78c-w6vf-rw82) is a high-severity flaw in Gradle's dependency resolution engine affecting versions prior to 8.14.4 and versions 9.0.0 through 9.2.1. Due to improper error handling when transient network errors or connection failures exhaust their retry limits, Gradle fails to mark unreachable repositories as disabled and does not abort the resolution queue. Instead, it silently falls through to subsequent repositories configured in the build script. This behavior enables dependency confusion and supply chain attacks when an internal or primary repository experiences connectivity issues, unresolvable DNS, or domain registration lapses.