CVE-2026-77420: JLine Denial of Service Vulnerability

MODERATE
Advisory Identifier: GHSA-5q95-hrpc-m3w3
CVSS 5.5
CWE-1333
Published
Advisory Summary

CVE-2026-77420 is a MODERATE (CVSS 5.5) denial of service vulnerability (CWE-1333: Inefficient Regular Expression Complexity) affecting JLine libraries in the Maven ecosystem. The issue involves redos via `history_ignore` configuration variable. Remediation is available by upgrading affected packages to version 4.3.1, 3.30.15.

CVE-2026-77420 at a Glance

CVE Identifier CVE-2026-77420
GHSA Identifier GHSA-5q95-hrpc-m3w3
Severity MODERATE
CVSS v3.1 Base Score 5.5
CWE Classification CWE-1333: Inefficient Regular Expression Complexity
Affected Product JLine
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 5.5

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

Attack Vector Local (AV:L)
Attack Complexity Low (AC:L)
Privileges Required Low (PR:L)
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-77420

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.

org.jline:jline-reader fixed: 4.3.1
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-reader</artifactId>
    <version>4.3.1</version>
</dependency>
org.jline:jline-reader fixed: 3.30.15
<dependency>
    <groupId>org.jline</groupId>
    <artifactId>jline-reader</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-77420, 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

### Summary The JLine3 `HISTORY_IGNORE` variable is converted into a Java regular expression with only partial escaping. As a result, regex metacharacters other than `*` and `:` are passed through to the regex engine. A crafted value such as `(a+)+b` can cause catastrophic backtracking each time a command line is added to history, hanging the reader thread at high CPU. ### Details In `reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java`, `matchPatterns()` converts `HISTORY_IGNORE` into a regex: ```java for (int i = 0; i < patterns.length(); i++) { char ch = patterns.charAt(i); if (ch == '\\') { ch = patterns.charAt(++i); sb.append(ch); } else if (ch == ':') { sb.append('|'); } else if (ch == '*') { sb.append('.').append('*'); } else { sb.append(ch); } } return line.matches(sb.toString()); ``` This logic translates wildcard syntax but does not escape regex metacharacters such as `(`, `)`, `+`, `?`, `{`, `}`, `[`, and `]`. Those characters therefore reach the Java regex engine unchanged. Affected source location: - `reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java` - `matchPatterns(String patterns, String line)` ### PoC 1. Configure `HISTORY_IGNORE` to a malicious pattern, for example: ```sh set history-ignore "(a+)+b" ``` 2. At the JLine prompt, enter a long non-matching line: ```text aaaaaaaaaaaaaaaaaaaaaaaaaaax ``` 3. Press Enter. Expected result: - The prompt does not return. - The reader 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. Applications embedding `org.jline:jline-reader` are impacted if they allow `HISTORY_IGNORE` to be configured through user configuration or application settings. The issue is lower severity than the interactive editor findings because the attacker must control configuration, but it can still reliably hang a reader session. ### Suggested Fix The safest fix for the current git head is to stop treating arbitrary `HISTORY_IGNORE` content as a regex. Instead, escape all characters by default and translate only the intended JLine wildcard syntax (`*`) and separator syntax (`:`). Suggested patch: ```diff diff --git a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java --- a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java +++ b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java @@ StringBuilder sb = new StringBuilder(); for (int i = 0; i < patterns.length(); i++) { char ch = patterns.charAt(i); if (ch == '\\') { ch = patterns.charAt(++i); - sb.append(ch); + sb.append(Pattern.quote(Character.toString(ch))); } else if (ch == ':') { sb.append('|'); } else if (ch == '*') { sb.append('.').append('*'); } else { - sb.append(ch); + sb.append(Pattern.quote(Character.toString(ch))); } } return line.matches(sb.toString()); ``` ### Credits This issue was identified by Michał Majchrowicz and Marcin Wyczechowski, members of the AFINE Team.

CVE-2026-77420 Affected JLine Versions

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

References

Frequently Asked Questions

What is CVE-2026-77420?
CVE-2026-77420 is a security vulnerability in JLine involving ReDoS via `HISTORY_IGNORE` Configuration Variable under CWE-1333: Inefficient Regular Expression Complexity.
Which JLine versions are affected?
Affected versions include releases prior to 4.3.1, 3.30.15 across affected packages: org.jline:jline-reader.
What version fixes CVE-2026-77420?
Upgrading to 4.3.1, 3.30.15 (or the latest patched release for your respective branch) resolves the vulnerability.
Is jline-reader affected?
Yes, org.jline:jline-reader 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-77420?
CVE-2026-77420 has a CVSS v3.1 base score of 5.5 (MODERATE) with vector string CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H.
What CWE is associated with CVE-2026-77420?
CVE-2026-77420 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-77420?
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-5q95-hrpc-m3w3",
  "modified" : "2026-09-23T18:12:06Z",
  "published" : "2026-09-23T18:12:05Z",
  "aliases" : [ "CVE-2026-77420" ],
  "summary" : "JLine: ReDoS via `HISTORY_IGNORE` Configuration Variable",
  "details" : "### Summary\n\nThe JLine3 `HISTORY_IGNORE` variable is converted into a Java regular expression with\nonly partial escaping. As a result, regex metacharacters other than `*` and `:` are\npassed through to the regex engine. A crafted value such as `(a+)+b` can cause\ncatastrophic backtracking each time a command line is added to history, hanging the\nreader thread at high CPU.\n\n### Details\n\nIn `reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java`,\n`matchPatterns()` converts `HISTORY_IGNORE` into a regex:\n\n```java\nfor (int i = 0; i < patterns.length(); i++) {\n    char ch = patterns.charAt(i);\n    if (ch == '\\\\') {\n        ch = patterns.charAt(++i);\n        sb.append(ch);\n    } else if (ch == ':') {\n        sb.append('|');\n    } else if (ch == '*') {\n        sb.append('.').append('*');\n    } else {\n        sb.append(ch);\n    }\n}\nreturn line.matches(sb.toString());\n```\n\nThis logic translates wildcard syntax but does not escape regex metacharacters such as\n`(`, `)`, `+`, `?`, `{`, `}`, `[`, and `]`. Those characters therefore reach the Java\nregex engine unchanged.\n\nAffected source location:\n- `reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java`\n- `matchPatterns(String patterns, String line)`\n\n### PoC\n\n1. Configure `HISTORY_IGNORE` to a malicious pattern, for example:\n\n```sh\nset history-ignore \"(a+)+b\"\n```\n\n2. At the JLine prompt, enter a long non-matching line:\n\n```text\naaaaaaaaaaaaaaaaaaaaaaaaaaax\n```\n\n3. Press Enter.\n\nExpected result:\n- The prompt does not return.\n- The reader 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.\nApplications embedding `org.jline:jline-reader` are impacted if they allow\n`HISTORY_IGNORE` to be configured through user configuration or application settings.\nThe issue is lower severity than the interactive editor findings because the attacker\nmust control configuration, but it can still reliably hang a reader session.\n\n### Suggested Fix\n\nThe safest fix for the current git head is to stop treating arbitrary `HISTORY_IGNORE`\ncontent as a regex. Instead, escape all characters by default and translate only the\nintended JLine wildcard syntax (`*`) and separator syntax (`:`).\n\nSuggested patch:\n\n```diff\ndiff --git a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java\n--- a/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java\n+++ b/reader/src/main/java/org/jline/reader/impl/history/DefaultHistory.java\n@@\n         StringBuilder sb = new StringBuilder();\n         for (int i = 0; i < patterns.length(); i++) {\n             char ch = patterns.charAt(i);\n             if (ch == '\\\\') {\n                 ch = patterns.charAt(++i);\n-                sb.append(ch);\n+                sb.append(Pattern.quote(Character.toString(ch)));\n             } else if (ch == ':') {\n                 sb.append('|');\n             } else if (ch == '*') {\n                 sb.append('.').append('*');\n             } else {\n-                sb.append(ch);\n+                sb.append(Pattern.quote(Character.toString(ch)));\n             }\n         }\n         return line.matches(sb.toString());\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:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-reader"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "4.0.0"
      }, {
        "fixed" : "4.3.1"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "Maven",
      "name" : "org.jline:jline-reader"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "3.0.0"
      }, {
        "fixed" : "3.30.15"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/jline/jline3/security/advisories/GHSA-5q95-hrpc-m3w3"
  }, {
    "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" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-23T18:12:05Z",
    "nvd_published_at" : null
  }
}