CVE-2026-77422: JLine Denial of Service Vulnerability
HIGHCVE-2026-77422 is a HIGH (CVSS 7.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting JLine libraries in the Maven ecosystem. The issue involves redos in built-in grep command amplified by automatic `.*` wrapping. Remediation is available by upgrading affected packages to version 4.3.1, 3.30.15.
CVE-2026-77422 at a Glance
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).
How to Fix CVE-2026-77422
To remediate this vulnerability, upgrade all affected JLine dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-builtins</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.jline</groupId>
<artifactId>jline-builtins</artifactId>
<version>3.30.15</version>
</dependency>
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-77422, 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 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, 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
CVE-2026-77422 Affected JLine Versions
2 component(s)| 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.0.0
< 3.30.15
|
3.30.15
|
References
Frequently Asked Questions
What is CVE-2026-77422?
Which JLine versions are affected?
What version fixes CVE-2026-77422?
Is jline-builtins affected?
What is the CVSS score of CVE-2026-77422?
What CWE is associated with CVE-2026-77422?
How can I check Maven dependencies for CVE-2026-77422?
Machine-readable OSV JSON
OSV v1.5 Schema
{
"schema_version" : "1.4.0",
"id" : "GHSA-r2xf-8xr9-62gw",
"modified" : "2026-09-23T18:12:36Z",
"published" : "2026-09-23T18:12:35Z",
"aliases" : [ "CVE-2026-77422" ],
"summary" : "JLine: ReDoS in Built-in grep Command Amplified by Automatic `.*` Wrapping",
"details" : "### Summary\n\nThe JLine3 built-in `grep` command wraps the user-supplied regular expression with\n`.*` before compiling it with Java's backtracking regex engine. This amplifies\ncatastrophic backtracking and allows a short pattern such as `(a+)+b` to hang the\ncommand thread on non-matching input. In environments that expose the JLine shell to\nremote users, this is a denial-of-service issue.\n\n### Details\n\nIn `builtins/src/main/java/org/jline/builtins/PosixCommands.java`, the grep\nimplementation rewrites the user pattern before compilation:\n\n```java\nString regex = args.remove(0);\nString regexp = regex;\nif (opt.isSet(\"word-regexp\")) {\n regexp = \"\\\\b\" + regexp + \"\\\\b\";\n}\nif (opt.isSet(\"line-regexp\")) {\n regexp = \"^\" + regexp + \"$\";\n} else {\n regexp = \".*\" + regexp + \".*\";\n}\n```\n\nThe transformed pattern is compiled with `Pattern.compile(...)` and then used to test\neach input line. For a payload such as `(a+)+b`, the automatic `.*` prefix and suffix\nincrease the backtracking search space substantially.\n\nAffected source location:\n- `builtins/src/main/java/org/jline/builtins/PosixCommands.java`\n- `grep(...)`\n\n### PoC\n\n1. Create a file containing a long run of `a` characters:\n\n```sh\nprintf 'aaaaaaaaaaaaaaaaaaaaaaa\\n' > /tmp/testfile.txt\n```\n\n2. Run JLine3's built-in `grep` against that file:\n\n```sh\ngrep '(a+)+b' /tmp/testfile.txt\n```\n\nExpected result:\n- The command stops responding.\n- The executing thread consumes high CPU.\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 built-in `grep`\ncommand is impacted. In remote shell deployments, an attacker can occupy a worker\nthread indefinitely and repeat the attack across multiple sessions to reduce service\navailability for other users.\n\n### Suggested Fix\n\nThe preferred fix for the current git head is:\n- stop rewriting non-line-regexp searches as `.*...*`\n- use `Matcher.find()` for substring semantics\n- compile user patterns with 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/PosixCommands.java b/builtins/src/main/java/org/jline/builtins/PosixCommands.java\n--- a/builtins/src/main/java/org/jline/builtins/PosixCommands.java\n+++ b/builtins/src/main/java/org/jline/builtins/PosixCommands.java\n@@\n-import java.util.regex.Pattern;\n+import com.google.re2j.Pattern;\n@@\n if (opt.isSet(\"line-regexp\")) {\n regexp = \"^\" + regexp + \"$\";\n- } else {\n- regexp = \".*\" + regexp + \".*\";\n }\n@@\n- boolean m = p.matcher(line).matches();\n+ boolean m = opt.isSet(\"line-regexp\")\n+ ? p.matcher(line).matches()\n+ : p.matcher(line).find();\n```\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" : "4.0.0"
}, {
"fixed" : "4.3.1"
} ]
} ]
}, {
"package" : {
"ecosystem" : "Maven",
"name" : "org.jline:jline-builtins"
},
"ranges" : [ {
"type" : "ECOSYSTEM",
"events" : [ {
"introduced" : "3.0.0"
}, {
"fixed" : "3.30.15"
} ]
} ]
} ],
"references" : [ {
"type" : "WEB",
"url" : "https://github.com/jline/jline3/security/advisories/GHSA-r2xf-8xr9-62gw"
}, {
"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-09-23T18:12:35Z",
"nvd_published_at" : null
}
}