NIST deprecates RSA-2048 from 2030. Find every one of them before attackers do.
☕
☕ Maven
Not in CISA KEV
HIGH severity

jline3 leads to ReDoS in Built-in Less Viewer SearchGHSA-2v9w-34q6-wpqx

HIGHFix: jline/jline3#2012

GHSA-2v9w-34q6-wpqx is a high-severity (CVSS 7.5) CWE-1333 vulnerability in org.jline:jline-builtins. A fix is available for org.jline:jline-builtins — see the affected versions and patch details below.

Also known asCVE-2026-77423
Published
Updated
Affected
2 pkgs
Patched
2 / 2
Exploits
None indexed
Exploitation data as of Nov 22, 2026 · OSV.dev, NVD, FIRST.org (EPSS)

Exploitation Status

Proof-of-concept exploit code exists

  • CISA’s SSVC triage found public proof-of-concept exploit code for this CVE, though no confirmed active exploitation.
  • CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.

Exploitation and automatability from CISA’s SSVC triage for GHSA-2v9w-34q6-wpqx.

EPSS Exploitation Probability

via FIRST.org ↗
0.5%probability of exploitation in next 30 days
Lower Risk0.00%
Lower risk than most CVEs41th percentile — riskier than 41% of all scored CVEsHighest risk
0.00%0.32%0.64%0.96%0.4%0.5%0.5%Oct 26Nov 26Nov 26

Probability of exploitation in the next 30 days, from FIRST.org EPSS.

How urgent is this, really

Where this sits among everything scored

Real-World Exposure

2 pkgs affected
☕org.jline:jline-builtins☕org.jline:jline-builtins

Real-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.

Description

Summary

The JLine3 built-in less pager compiles user-supplied search patterns directly as Java regular expressions with no sanitization, timeout, or backtracking bound. A malicious pattern such as (a+)+b can trigger catastrophic backtracking and hang the session thread at 100% CPU. In deployments that expose less over Telnet or SSH, this becomes a denial-of-service issue for the affected session and can be used to exhaust a bounded session pool.

Details

Less.getPattern() in builtins/src/main/java/org/jline/builtins/Less.java compiles the user-controlled search string directly with Pattern.compile():

private Pattern getPattern(boolean doDisplayPattern) {
    Pattern compiled = null;
    String _pattern = doDisplayPattern ? displayPattern : pattern;
    if (_pattern != null) {
        boolean insensitive =
                ignoreCaseAlways || ignoreCaseCond && _pattern.toLowerCase().equals(_pattern);
        compiled = Pattern.compile(
                "(" + _pattern + ")", insensitive ? Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE : 0);
    }
    return compiled;
}

The resulting pattern is then applied repeatedly against file content with compiled.matcher(line).find() in the less search path. Because Java's java.util.regex engine is backtracking-based and has no built-in timeout, patterns with nested quantifiers can take exponential time on non-matching input.

Affected source locations:

  • builtins/src/main/java/org/jline/builtins/Less.java
  • getPattern(boolean doDisplayPattern)
  • search callers using compiled.matcher(line).find()

PoC

  1. Create a file with a long run of a characters:
printf 'aaaaaaaaaaaaaaaaaaaaaaaaa\n' > /tmp/testfile.txt
  1. Open the file with the JLine3 less viewer.
  2. Press / to enter search mode.
  3. Enter the pattern (a+)+b and press Enter.

Expected result:

  • The less session stops responding.
  • The session thread consumes high CPU.

Variation:

  • The same behavior can be triggered through the display-filter path using & because that path also compiles user input as a raw Java regex.

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 less viewer is impacted. In local use, the affected user can hang their own session. In multi-user Telnet or SSH deployments, one attacker can occupy one session thread indefinitely and multiple attackers or sessions can exhaust the server's available worker pool.

Suggested Fix

The preferred fix for the current git head is to move user-controlled regex matching to a linear-time engine such as RE2/J.

Suggested patch:

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/Less.java b/builtins/src/main/java/org/jline/builtins/Less.java
--- a/builtins/src/main/java/org/jline/builtins/Less.java
+++ b/builtins/src/main/java/org/jline/builtins/Less.java
@@
-import java.util.regex.Pattern;
+import com.google.re2j.Pattern;
@@
         if (_pattern != null) {
             boolean insensitive =
                     ignoreCaseAlways || ignoreCaseCond && _pattern.toLowerCase().equals(_pattern);
             compiled = Pattern.compile(
                     "(" + _pattern + ")",
                     insensitive ? Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE : 0);
         }

If introducing RE2/J is not acceptable, a weaker fallback is to perform regex matching in a worker with a strict timeout and reject patterns that exceed the time budget.

Credits

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

Affected Packages

2 total 2 fixed
EcosystemPackageVulnerable rangeFix
☕Mavenorg.jline:jline-builtinsall versions3.30.15org.jline:jline-builtins:3.30.15
☕Mavenorg.jline:jline-builtins≥ 4.0.0&&< 4.3.14.3.1org.jline:jline-builtins:4.3.1

Detection & mitigation playbook

Open-source dependency
  1. Detect

    Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for org.jline:jline-builtins, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.

  2. Fix

    Update org.jline:jline-builtins to 3.30.15 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-2v9w-34q6-wpqx is resolved across your whole dependency graph.

  3. Workarounds

    If you can't upgrade right away: gate or disable the affected feature, validate untrusted input at the boundary, and avoid passing attacker-controlled data into the vulnerable path. O3's runtime protection blocks exploitation in production as an interim safeguard until the upgrade lands.

Fixing This On Your OS

If you run this on a Linux distribution, patch through your package manager against the distro's own security advisory below — it tracks the exact backported fix for your release, which can ship on a different timeline (and sometimes a different severity) than the upstream project.

Red HatImportant

This is an Important denial-of-service vulnerability in the JLine built-in less viewer. Exploitation occurs when user-controlled regular expressions are processed, leading to excessive CPU consumption and potential session thread exhaustion. This risk is particularly relevant in Red Hat products utilizing JLine in…

Workaround published by Red Hat
Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base, or stability.
Source: Red Hat security advisory for GHSA-2v9w-34q6-wpqx (CC BY 4.0)

Frequently Asked Questions

### Summary The JLine3 built-in `less` pager compiles user-supplied search patterns directly as Java regular expressions with no sanitization, timeout, or backtracking bound. A malicious pattern such as `(a+)+b` can trigger catastrophic backtracking and hang the session thread at 100% CPU. In deployments that expose `less` over Telnet or SSH, this becomes a denial-of-service issue for the affected session and can be used to exhaust a bounded session pool. ### Details `Less.getPattern()` in `builtins/src/main/java/org/jline/builtins/Less.java` compiles the user-controlled search string direc
O3 Security · Impact-Aware SCA

Is GHSA-2v9w-34q6-wpqx in your dependencies?

Find it across Maven, including transitive dependencies.

jline3 leads to ReDoS in Built-in Less Viewer Search