Vulnerabilities in pkg:maven/org.jline/jline-builtins

PACKAGE
Advisory Identifier: GHSA-2v9w-34q6-wpqx
Advisory Summary

CVE-2026-77423 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting Jline builtins libraries in the Maven ecosystem. The issue involves jline3 leads to redos in built-in less viewer search. Remediation is available by upgrading affected packages to version 4.3.1, 3.30.15.

3 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:maven/org.jline/jline-builtins

3 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:maven/org.jline/jline-builtins. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-2v9w-34q6-wpqx CVE-2026-77423 HIGH jline3 leads to ReDoS in Built-in Less Viewer Search
GHSA-ph9c-7hw9-vhhw CVE-2026-77421 MODERATE JLine: ReDoS in Nano Editor Regex Search Mode
GHSA-r2xf-8xr9-62gw CVE-2026-77422 HIGH JLine: ReDoS in Built-in grep Command Amplified by Automatic `.*` Wrapping

CVE-2026-77423 at a Glance

CVE Identifier CVE-2026-77423
GHSA Identifier GHSA-2v9w-34q6-wpqx
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product Jline builtins
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 7.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity None (I:N)
Availability High (A:H)

How to Fix CVE-2026-77423

To remediate this vulnerability, upgrade all affected Jline builtins dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

org.jline:jline-builtins fixed: 4.3.1
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-builtins</artifactId>
    <version>4.3.1</version>
</dependency>
org.jline:jline-builtins fixed: 3.30.15
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-builtins</artifactId>
    <version>3.30.15</version>
</dependency>
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

mvn dependency:tree -Dincludes=org.jline

How to Check if You Are Affected

To determine whether your Java application is affected by CVE-2026-77423, inspect your build dependencies using the Maven Dependency Plugin:

mvn dependency:tree -Dincludes=org.jline

Analyze the terminal output to locate any version of Jline builtins in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 4.3.1), your application is affected.

Note: The mvn dependency:tree -Dincludes=org.jline command inspects the resolved dependency graph declared in your project's POM files; it does not perform automated security scanning or inspect runtime dynamic classpaths. Always verify runtime container classpaths and shaded JARs.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-1333: Inefficient Regular Expression Complexity, where the product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential. In Jline builtins, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### 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()`: ```java 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: ```sh printf 'aaaaaaaaaaaaaaaaaaaaaaaaa\n' > /tmp/testfile.txt ``` 2. Open the file with the JLine3 `less` viewer. 3. Press `/` to enter search mode. 4. 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 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.

CVE-2026-77423 Affected Jline builtins Versions

2 component(s)
Fixed Versions:
4.3.13.30.15
Product / Package Ecosystem Affected Versions Fixed Version
org.jline:jline-builtins
Maven
≥ 4.0.0
< 4.3.1
4.3.1
org.jline:jline-builtins
Maven
< 3.30.15
3.30.15

References

Frequently Asked Questions

What is CVE-2026-77423?
CVE-2026-77423 is a security vulnerability in Jline builtins involving jline3 leads to ReDoS in Built-in Less Viewer Search under CWE-1333: Inefficient Regular Expression Complexity.
Which Jline builtins versions are affected?
Affected versions include releases prior to 4.3.1, 3.30.15 across affected packages: org.jline:jline-builtins.
What version fixes CVE-2026-77423?
Upgrading to 4.3.1, 3.30.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jline-builtins affected?
Yes, org.jline:jline-builtins is affected in releases prior to 4.3.1, 3.30.15. Upgrade your dependency to 4.3.1, 3.30.15 or later.
What is the CVSS score of CVE-2026-77423?
CVE-2026-77423 has a CVSS v3.1 base score of 7.5 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-77423?
CVE-2026-77423 is classified under CWE-1333: Inefficient Regular Expression Complexity (The product uses a regular expression with a worst-case computational complexity that is inefficient and possibly exponential.).
How can I check Maven dependencies for CVE-2026-77423?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=org.jline'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-2v9w-34q6-wpqx",
  "modified" : "2026-11-23T21:02:03Z",
  "published" : "2026-11-23T21:02:03Z",
  "aliases" : [ "CVE-2026-77423" ],
  "summary" : "jline3 leads to ReDoS in Built-in Less Viewer Search",
  "details" : "### Summary\n\nThe JLine3 built-in `less` pager compiles user-supplied search patterns directly as\nJava regular expressions with no sanitization, timeout, or backtracking bound. A\nmalicious pattern such as `(a+)+b` can trigger catastrophic backtracking and hang the\nsession thread at 100% CPU. In deployments that expose `less` over Telnet or SSH,\nthis becomes a denial-of-service issue for the affected session and can be used to\nexhaust a bounded session pool.\n\n### Details\n\n`Less.getPattern()` in `builtins/src/main/java/org/jline/builtins/Less.java` compiles\nthe user-controlled search string directly with `Pattern.compile()`:\n\n```java\nprivate Pattern getPattern(boolean doDisplayPattern) {\n    Pattern compiled = null;\n    String _pattern = doDisplayPattern ? displayPattern : pattern;\n    if (_pattern != null) {\n        boolean insensitive =\n                ignoreCaseAlways || ignoreCaseCond && _pattern.toLowerCase().equals(_pattern);\n        compiled = Pattern.compile(\n                \"(\" + _pattern + \")\", insensitive ? Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE : 0);\n    }\n    return compiled;\n}\n```\n\nThe resulting pattern is then applied repeatedly against file content with\n`compiled.matcher(line).find()` in the `less` search path. Because Java's\n`java.util.regex` engine is backtracking-based and has no built-in timeout, patterns\nwith nested quantifiers can take exponential time on non-matching input.\n\nAffected source locations:\n- `builtins/src/main/java/org/jline/builtins/Less.java`\n- `getPattern(boolean doDisplayPattern)`\n- search callers using `compiled.matcher(line).find()`\n\n### PoC\n\n1. Create a file with a long run of `a` characters:\n\n```sh\nprintf 'aaaaaaaaaaaaaaaaaaaaaaaaa\\n' > /tmp/testfile.txt\n```\n\n2. Open the file with the JLine3 `less` viewer.\n3. Press `/` to enter search mode.\n4. Enter the pattern `(a+)+b` and press Enter.\n\nExpected result:\n- The `less` session stops responding.\n- The session thread consumes high CPU.\n\nVariation:\n- The same behavior can be triggered through the display-filter path using `&` because\n  that path also compiles user input as a raw Java regex.\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.\nAny application embedding `org.jline:jline-builtins` and exposing the `less` viewer\nis impacted. In local use, the affected user can hang their own session. In multi-user\nTelnet or SSH deployments, one attacker can occupy one session thread indefinitely and\nmultiple attackers or sessions can exhaust the server's available worker pool.\n\n### Suggested Fix\n\nThe preferred fix for the current git head is to move user-controlled regex matching\nto a linear-time engine such as RE2/J.\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         <dependency>\n+            <groupId>com.google.re2j</groupId>\n+            <artifactId>re2j</artifactId>\n+            <version>1.8</version>\n+        </dependency>\n+        <dependency>\n             <groupId>org.jline</groupId>\n             <artifactId>jline-reader</artifactId>\n         </dependency>\n\ndiff --git a/builtins/src/main/java/org/jline/builtins/Less.java b/builtins/src/main/java/org/jline/builtins/Less.java\n--- a/builtins/src/main/java/org/jline/builtins/Less.java\n+++ b/builtins/src/main/java/org/jline/builtins/Less.java\n@@\n-import java.util.regex.Pattern;\n+import com.google.re2j.Pattern;\n@@\n         if (_pattern != null) {\n             boolean insensitive =\n                     ignoreCaseAlways || ignoreCaseCond && _pattern.toLowerCase().equals(_pattern);\n             compiled = Pattern.compile(\n                     \"(\" + _pattern + \")\",\n                     insensitive ? Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE : 0);\n         }\n```\n\nIf introducing RE2/J is not acceptable, a weaker fallback is to perform regex matching\nin a worker with a strict timeout and reject patterns that exceed the time budget.\n\n### Credits\n\nThis issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-builtins"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "3.30.15"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-builtins"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.3.1"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/security/advisories/GHSA-2v9w-34q6-wpqx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-77423"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/pull/2012"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/pull/2018"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/commit/1d5fc3099e77938b971e197211cad2d4fbb17541"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/commit/341ee69ccc57b7733c1b40d6993219b64b3206ae"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/jline/jline3"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/releases/tag/4.3.1"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/releases/tag/jline-3.30.15"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-1333" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-11-23T21:02:03Z",
    "nvd_published_at" : "2026-09-23T19:19:16Z"
  }
}