Skip to main content

JLine3 EUVDEUVD-2026-85527

| CVE-2026-77422 HIGH
Inefficient Regular Expression Complexity (ReDoS) (CWE-1333)
2026-09-23 https://github.com/jline/jline3 GHSA-r2xf-8xr9-62gw
7.5
CVSS 3.1 · Vendor: https://github.com/jline/jline3
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Reach exposed JLine grep shell
  2. Delivery
    Submit crafted regex '(a+)+b'
  3. Exploit
    .* wrapping amplifies backtracking
  4. Execution
    Worker thread pinned at 100% CPU
  5. Persist
    Repeat across sessions
  6. Impact
    Service availability degraded

Vulnerability Assessment

Weakness
CWE
ASVS 5.0
V2 - Validation and Business Logic Regex complexity limits
MITRE ATT&CK

1 technique across 1 tactic: Impact

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires an application that (1) depends on org.jline:jline-builtins in a vulnerable range (>=3.0.0 <3.30.15 or >=4.0.0 <4.3.1) and (2) exposes the built-in grep command to attacker-controllable pattern input, typically via a remote or interactive JLine shell. The specific trigger is the code path for non-line-regexp searches, where the user pattern is auto-wrapped as '.*'+pattern+'.*' and compiled with Java's backtracking engine; supplying a pathological pattern like '(a+)+b' against non-matching input causes catastrophic backtracking. Limiting factors: the grep builtin must actually be reachable by the attacker (many embedders never expose it or gate it behind authentication), impact is confined to CPU/thread exhaustion (no data or code impact), and the '--line-regexp' path is not affected by the '.*' wrapping. If grep is not exposed to untrusted users, the vulnerability is not reachable.

Impact

This is a CWE-1333 regular-expression denial-of-service (ReDoS) in JLine3's built-in grep command. The vendor CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H, base 7.5) rates it high, but the real-world risk is heavily gated by deployment: it only bites applications that embed org.jline:jline-builtins AND expose the built-in grep command to attacker-supplied input, typically via a remote/interactive shell. There is no EPSS score, no CISA KEV listing, and no independent exploit weaponization reported - however a working PoC ('grep '(a+)+b'' against a line of repeated 'a's) is published in the GHSA advisory, so exploitation is trivially reproducible for anyone who reaches the grep prompt. Impact is availability-only (C:N/I:N); it occupies a worker thread with catastrophic backtracking rather than corrupting data or executing code. The AV:N and PR:N in the vendor vector describe the most exposed configuration (a network-reachable shell), but many embedders either do not expose grep at all or place it behind an authenticated session - so for most deployments this is a moderate, condition-dependent hardening fix rather than an urgent priority. Signals are internally consistent (high-CVSS on availability, PoC present, no active exploitation), pointing to a real but low-urgency DoS.

Exploit ScenarioDerived

An application embeds jline-builtins and exposes the built-in grep command through a network-accessible interactive shell. An attacker submits a crafted pattern such as '(a+)+b' against input that never matches, triggering catastrophic backtracking that pins a worker thread at 100% CPU; repeating this across sessions degrades availability for other users. A public PoC exists in the vendor GHSA advisory.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.5% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – Sep 23, 2026

Denial of service in JLine3's built-in grep command (org.jline:jline-builtins) lets anyone who can supply a search pattern hang a worker thread indefinitely via catastrophic regular-expression backtracking. The builtin - reachable in applications that embed JLine3 and expose the shell to remote or interactive users - rewrites non-line-regexp patterns as .*pattern.* before compiling them with Java's backtracking regex engine, so a short input such as (a+)+b tested against non-matching text causes exponential CPU consumption (CWE-1333; CVSS 3.1 base 7.5 upstream, while the assessed vector requires low privileges, PR:L). Impact is availability-only (C:N/I:N/A:H) with no confidentiality or integrity loss; publicly available exploit code exists in the form of the advisory's two-line PoC, but the issue is not listed in CISA KEV and no confirmed active exploitation has been reported. Vendor-fixed releases are available: 3.30.15 on the 3.x line and 4.3.1 on the 4.x line.

RemediationAI

Vendor-released patch: upgrade org.jline:jline-builtins to 3.30.15 (3.x line) or 4.3.1 (4.x line), which remove the '.*' wrapping and route grep/less/nano/history through the SafeRegex wrapper with RegexTimeoutException; the corresponding changes are in https://github.com/jline/jline3/pull/2012 and https://github.com/jline/jline3/pull/2018, with the advisory at https://github.com/jline/jline3/security/advisories/GHSA-r2xf-8xr9-62gw. If upgrading is not immediately possible, the most effective compensating control is to not expose the JLine grep builtin to untrusted input at all - remove it from the exposed command set or gate the shell behind strong authentication - accepting the trade-off that legitimate users lose the grep builtin; alternatively restrict shell reachability to trusted networks or local terminals, since the vulnerability is only reachable when an attacker can submit the search pattern. Do not rely on --line-regexp as a general mitigation: it avoids the '.*' amplification but still compiles attacker-supplied patterns with the backtracking engine. Where code changes can be made without a full upgrade, backport the SafeRegex/RegexTimeoutException wrapper around the grep pattern compile-and-match path (execution is aborted on timeout), noting the trade-off that aborted matches silently return partial results in the nano/less search paths; adopting a linear-time engine such as RE2/J as suggested in the advisory eliminates catastrophic backtracking at the cost of losing Java-specific regex features (backreferences, lookaround). No patch backport to unmaintained 3.x/4.x versions below the fixed releases is indicated in the available data.

Affected VersionsENISA

jline3 3.0.0, < 3.30.15
jline3 4.0.0, < 4.3.1

Affected Packages

maven org.jline:jline-builtins fix: 3.30.15, 4.3.1
euvd jline3_3_0_0 fix: 3.30.15
euvd jline3_4_0_0 fix: 4.3.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 3 packages in maven, euvd

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

The flaw is a classic regular-expression denial of service (CWE-1333) rooted in the use of Java's backtracking java.util.regex engine on attacker-influenced input. In builtins/src/main/java/org/jline/builtins/PosixCommands.java, the grep(...) implementation takes the user's pattern and, unless --line-regexp is set, rewrites it as '.*' + pattern + '.*' (and wraps it with \b...\b when --word-regexp is set) before calling Pattern.compile(...) and Pattern.matcher(line).matches(). The automatic '.*' prefix and suffix, combined with the whole-line matches() semantics, massively expand the backtracking search space, so nested quantifiers such as (a+)+b blow up on non-matching lines. The affected artifact is the Maven package org.jline:jline-builtins (CPE pkg:maven/org.jline:jline-builtins), a component that embedders pull in to get POSIX-like shell builtins; any host application that invokes the grep builtin with untrusted pattern input inherits the vulnerability. The upstream fix (PRs #2012 and #2018, commits 1d5fc3099e77938b971e197211cad2d4fbb17541 and 341ee69ccc57b7733c1b40d6993219b64b3206ae) removes the '.*' wrapping, switches substring semantics to SafeRegex.find(...) (Matcher.find()) versus SafeRegex.matches(...) for --line-regexp, and introduces an org.jline.utils.SafeRegex wrapper plus RegexTimeoutException that bounds regex execution time for grep, nano, less and history glob matching; the advisory also suggests compiling user patterns with a linear-time engine such as RE2/J. Only the non-line-regexp code path is amplified by the '.*' rewriting; the --line-regexp path (^pattern$) is not affected by that amplification.

Know when Java gets its next vulnerability

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/jline/jline3) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
vuln.today AI 6.5 MEDIUM

Reaching the grep command typically requires an interactive/authenticated shell session, so PR:L; attack is trivial once reachable (AC:L) and repeatable thread exhaustion gives A:H, with no C/I impact.

3.1 AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
4.0 AV:N/AC:L/AT:N/PR:L/UI:N/VC:N/VI:N/VA:H/SC:N/SI:N/SA:N
SUSE HIGH
Red Hat 7.5 HIGH

Primary rating from Vendor (https://github.com/jline/jline3).

CVSS VectorVendor: https://github.com/jline/jline3

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
None
Integrity
None
Availability
High

DescriptionCVE.org

Summary

The JLine3 built-in grep command wraps the user-supplied regular expression with .* before compiling it with Java's backtracking regex engine. This amplifies catastrophic backtracking and allows a short pattern such as (a+)+b to hang the command thread on non-matching input. In environments that expose the JLine shell to remote users, this is a denial-of-service issue.

Details

In builtins/src/main/java/org/jline/builtins/PosixCommands.java, the grep implementation rewrites the user pattern before compilation:

java
String regex = args.remove(0);
String regexp = regex;
if (opt.isSet("word-regexp")) {
    regexp = "\\b" + regexp + "\\b";
}
if (opt.isSet("line-regexp")) {
    regexp = "^" + regexp + "$";
} else {
    regexp = ".*" + regexp + ".*";
}

The transformed pattern is compiled with Pattern.compile(...) and then used to test each input line. For a payload such as (a+)+b, the automatic .* prefix and suffix increase the backtracking search space substantially.

Affected source location:

  • builtins/src/main/java/org/jline/builtins/PosixCommands.java
  • grep(...)

PoC

  1. Create a file containing a long run of a characters:
sh
printf 'aaaaaaaaaaaaaaaaaaaaaaa\n' > /tmp/testfile.txt
  1. Run JLine3's built-in grep against that file:
sh
grep '(a+)+b' /tmp/testfile.txt

Expected result:

  • The command stops responding.
  • The executing 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. Any application embedding org.jline:jline-builtins and exposing the built-in grep command is impacted. In remote shell deployments, an attacker can occupy a worker thread indefinitely and repeat the attack across multiple sessions to reduce service availability for other users.

Suggested Fix

The preferred fix for the current git head is:

  • stop rewriting non-line-regexp searches as .*...*
  • use Matcher.find() for substring semantics
  • compile user patterns with a linear-time engine such as RE2/J

Suggested patch:

diff
diff --git a/builtins/pom.xml b/builtins/pom.xml
--- a/builtins/pom.xml
+++ b/builtins/pom.xml
@@
         <dependency>
+            <groupId>com.google.re2j</groupId>
+            <artifactId>re2j</artifactId>
+            <version>1.8</version>
+        </dependency>
+        <dependency>
             <groupId>org.jline</groupId>
             <artifactId>jline-reader</artifactId>
         </dependency>

diff --git a/builtins/src/main/java/org/jline/builtins/PosixCommands.java b/builtins/src/main/java/org/jline/builtins/PosixCommands.java
--- a/builtins/src/main/java/org/jline/builtins/PosixCommands.java
+++ b/builtins/src/main/java/org/jline/builtins/PosixCommands.java
@@
-import java.util.regex.Pattern;
+import com.google.re2j.Pattern;
@@
         if (opt.isSet("line-regexp")) {
             regexp = "^" + regexp + "$";
-        } else {
-            regexp = ".*" + regexp + ".*";
         }
@@
-        boolean m = p.matcher(line).matches();
+        boolean m = opt.isSet("line-regexp")
+                ? p.matcher(line).matches()
+                : p.matcher(line).find();

Credits

This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.

Blast Radius

ecosystem impact
† from your stack dependencies † transitive graph · vuln.today resolves 4-path depth
  • 8 maven packages depend on org.jline:jline-builtins (6 direct, 2 indirect)

Ecosystem-wide dependent count for version 4.0.0.

Technical POC Analysis

CWE-1333 (Inefficient Regular Expression Complexity).

Full technical POC analysis - root cause, step-by-step exploitation and patch breakdown - is part of the Pro and Business plans.

Executive ViewAI

Why It Matters

JLine3's built-in grep command, which ships inside the interactive shell and remote console interfaces of applications that embed it, can be hung indefinitely by a short crafted search pattern, letting a single low-privilege user pin worker threads and degrade or deny service to other users. The impact is availability only - there is no exposure of data or ability to alter it - so the primary business risk is operational downtime, support load, and disruption of dependent services rather than a data breach. Publicly available exploit code exists (no confirmed active exploitation), and vendor fixes are already published, making this a scheduled upgrade rather than an emergency response.

Business Impact: Medium
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.5%
Top 60% exploitable
Prevalence
Medium
JLine is a common Java console library, but builtins-grep exposure to remote input is narrower
Threat Intel
1
1 source
Exploit
POC
Public exploit code exists
Data Quality
7 sources
Confidence: High
EUVD NVD CVE.org EPSS Vulnrichment GHSA Vendor GitHub VulDB

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC Yes
EPSS 0.5%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision
Scheduled
Exploitation
Poc
System Exposure· derived
Open
Automatable
Yes
Human Impact
Medium
Technical Impact
Partial

Priority Score

58
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
PoC: +20
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Denial of Service attacks render applications or systems unavailable by overwhelming resources or triggering failure conditions.

More in Java

View all
CVE-2012-4681 CRITICAL POC
9.8 Aug 28

Oracle Java SE 7 Update 6 and earlier contains multiple sandbox bypass vulnerabilities via the ClassFinder and forName m

CVE-2015-7450 CRITICAL POC
9.8 Jan 02

Remote code execution in IBM Sterling B2B Integrator, Sterling Integrator, and Tivoli Common Reporting allows unauthenti

CVE-2013-2465 CRITICAL POC
9.8 Jun 18

Java Runtime Environment sandbox bypass via incorrect image channel verification in 2D component allows remote unauthent

CVE-2011-3544 CRITICAL POC
9.8 Oct 19

Oracle Java SE JDK/JRE 7 and 6 Update 27 and earlier allows remote code execution with complete system compromise throug

CVE-2010-1871 HIGH POC
8.8 Aug 05

JBoss Seam 2 in Red Hat JBoss EAP 4.3.0 fails to sanitize JBoss Expression Language inputs, allowing remote attackers to

CVE-2012-1723 CRITICAL POC
9.8 Jun 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 update 4 and earlier, 6 up

CVE-2013-0422 CRITICAL POC
9.8 Jan 10

Multiple vulnerabilities in Oracle Java 7 before Update 11 allow remote attackers to execute arbitrary code by (1) using

CVE-2012-0507 CRITICAL POC
9.8 Jun 07

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 2 and earlier, 6 Up

CVE-2015-4852 CRITICAL POC
9.8 Nov 18

The WLS Security component in Oracle WebLogic Server 10.3.6.0, 12.1.2.0, 12.1.3.0, and 12.2.1.0 allows remote attackers

CVE-2012-5076 CRITICAL POC
9.8 Oct 16

Unspecified vulnerability in the Java Runtime Environment (JRE) component in Oracle Java SE 7 Update 7 and earlier allow

CVE-2017-3066 CRITICAL POC
9.8 Apr 27

Remote unauthenticated attackers can execute arbitrary code on Adobe ColdFusion servers through Java deserialization fla

CVE-2012-0391 CRITICAL POC
9.8 Jan 08

The ExceptionDelegator component in Apache Struts before 2.2.3.1 interprets parameter values as OGNL expressions during

Vendor StatusVendor

SUSE

Severity: Important
Product Status
SUSE Linux Enterprise Server 16.0 Affected
SUSE Linux Enterprise Server 16.1 Affected
SUSE Linux Enterprise Server for SAP applications 16.0 Affected
SUSE Linux Enterprise Server for SAP applications 16.1 Affected
openSUSE Leap 16.0 Affected

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy