maven package report

Is org.jline:jline-builtins safe?

2 known vulnerabilities, worst severity HIGH.

// reach

0 direct dependencies

none carry a known advisory

    0 packages depend on it

    an advisory here reaches each of them

      Create a free accountfor every dependency path, dependent and what to upgrade
      // ai model usage

      Tracked for PyPI packages. HuggingFace models declare Python dependencies, so maven packages are not covered.


      cvss
      0.0
      high

      severity band, no base score published

      epss
      not scored

      chance of exploitation in 30 days

      xyz score
      0.0
      low

      CyberXYZ composite out of 10

      fig. 01 — GHSA-r2xf-8xr9-62gw, the advisory selected below

      // 2 advisories

      GHSA-r2xf-8xr9-62gw

      HIGHCVE-2026-77422
      // 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:

      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
      • Create a file containing a long run of a characters:
      printf 'aaaaaaaaaaaaaaaaaaaaaaa\n' > /tmp/testfile.txt
      • Run JLine3's built-in grep against that file:
      grep '(a+)+b' /tmp/testfile.txt

      Expected result:

      • The command stops responding.
      • The executing thread consumes high CPU.

      Reproduction environment:

      • JLine3 on x8664 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 --git a/builtins/pom.xml b/builtins/pom.xml
      --- a/builtins/pom.xml
      +++ b/builtins/pom.xml
      @@
               
      +            com.google.re2j
      +            re2j
      +            1.8
      +        
      +        
                   org.jline
                   jline-reader
               
      
      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.

      // cvss v3.1 vector

      CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H

      Attack vector
      Network
      Attack complexity
      Low
      Privileges required
      None
      User interaction
      None
      Scope
      Unchanged
      Confidentiality
      None
      Integrity
      None
      Availability
      High

      Checked 2026-09-24 at 08:38 UTC. The most recent advisory here was published 2026-09-23. Updated continuously from NVD, GHSA, OSV and CNA feeds.

      Think a verdict here is wrong? Tell us — we respond within 2 business days.
      Is org.jline:jline-builtins safe? maven package security report | CyberXYZ