CVE-2026-97370: Junrar RarVM VM_JMP MaxOpCount Bypass Causes Vulnerability

HIGH
Advisory Identifier: GHSA-h9h9-2rmf-rvhp
CVSS 7.5
CWE-835
Published
Advisory Summary

CVE-2026-97370 is a HIGH (CVSS 7.5) rarvm vm_jmp maxopcount bypass causes vulnerability (CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')) affecting Junrar libraries in the Maven ecosystem. The issue involves rarvm vm_jmp maxopcount bypass causes infinite cpu loop during rar4 extraction. Remediation is available by upgrading affected packages to version 7.6.1.

CVE-2026-97370 at a Glance

CVE Identifier CVE-2026-97370
GHSA Identifier GHSA-h9h9-2rmf-rvhp
Severity HIGH
CVSS v3.1 Base Score 7.5
CWE Classification CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop')
Affected Product Junrar
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-97370

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

com.github.junrar:junrar fixed: 7.6.1
<dependency>
    <groupId>com.github.junrar</groupId>
    <artifactId>junrar</artifactId>
    <version>7.6.1</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=com.github.junrar

How to Check if You Are Affected

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

mvn dependency:tree -Dincludes=com.github.junrar

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

Note: The mvn dependency:tree -Dincludes=com.github.junrar 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-835: Loop with Unreachable Exit Condition ('Infinite Loop'), where the product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop. In Junrar, 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 Junrar's RAR virtual machine can be forced into a deterministic infinite loop while extracting a crafted RAR4 archive. The `RarVM.ExecuteCode` loop is intended to be bounded by `maxOpCount`, but jump instructions can bypass this limit when `setIP()` is called with a target instruction pointer greater than or equal to `codeSize`. An unauthenticated attacker who can provide a RAR archive to an application using `Junrar.extract()` can cause the extraction thread to spin forever, consuming CPU and blocking the process. The issue is a denial of service vulnerability, not remote code execution. ### Details The root cause is in `src/main/java/com/github/junrar/unpack/vm/RarVM.java`. `setIP()` returns early when the target IP is outside the prepared VM program: ```java private boolean setIP(int ip) { if ((ip) >= codeSize) { return (true); } if (--maxOpCount <= 0) { return (false); } IP = ip; return true; } ``` When `ip >= codeSize`, this branch: - does not update `IP`; - does not decrement `maxOpCount`; - returns `true`, so callers treat it as success. The `VM_JMP` handler and the other jump-like handlers discard the return value of `setIP()` and immediately `continue` the main VM loop: ```java case VM_JMP: setIP(getValue(false, mem, op1)); continue; ``` Because of the `continue`, execution also skips the loop-end accounting: ```java IP++; --maxOpCount; ``` As a result, a VM program containing a single `VM_JMP` instruction can freeze both `IP` and `maxOpCount`: 1. `IP` points to the `VM_JMP` instruction. 2. The jump target resolves to `codeSize` or larger. 3. `setIP()` returns before modifying `IP` or decrementing `maxOpCount`. 4. The caller ignores the return value and continues. 5. The same `VM_JMP` instruction is executed again forever. ### Impact This is a CPU denial of service vulnerability. Any application that uses junrar to extract untrusted RAR archives can have an extraction worker thread permanently blocked by a small crafted archive. In services that process uploads or attachments automatically, repeated submissions can exhaust worker capacity and degrade or stop archive-processing functionality. The RAR VM does not provide native code execution, reflection, or process execution primitives, and Java array bounds checks prevent escaping the VM memory array. The expected security impact is availability only.

CVE-2026-97370 Affected Junrar Versions

1 component(s)
Fixed Versions:
7.6.1
Product / Package Ecosystem Affected Versions Fixed Version
com.github.junrar:junrar
Maven
< 7.6.1
7.6.1

References

Frequently Asked Questions

What is CVE-2026-97370?
CVE-2026-97370 is a security vulnerability in Junrar involving RarVM VM_JMP maxOpCount bypass causes infinite CPU loop during RAR4 extraction under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop').
Which Junrar versions are affected?
Affected versions include releases prior to 7.6.1 across affected packages: com.github.junrar:junrar.
What version fixes CVE-2026-97370?
Upgrading to 7.6.1 (or the latest patched release for your respective branch) resolves the vulnerability.
Is junrar affected?
Yes, com.github.junrar:junrar is affected in releases prior to 7.6.1. Upgrade your dependency to 7.6.1 or later.
What is the CVSS score of CVE-2026-97370?
CVE-2026-97370 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-97370?
CVE-2026-97370 is classified under CWE-835: Loop with Unreachable Exit Condition ('Infinite Loop') (The product contains an iteration or loop with an exit condition that cannot be reached, i.e., an infinite loop.).
How can I check Maven dependencies for CVE-2026-97370?
Run the dependency tree command: 'mvn dependency:tree -Dincludes=com.github.junrar'. 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-h9h9-2rmf-rvhp",
  "modified" : "2026-10-15T20:09:47Z",
  "published" : "2026-10-15T20:09:47Z",
  "aliases" : [ "CVE-2026-97370" ],
  "summary" : "Junrar: RarVM VM_JMP maxOpCount bypass causes infinite CPU loop during RAR4 extraction",
  "details" : "### Summary\n\nJunrar's RAR virtual machine can be forced into a deterministic infinite loop while extracting a crafted RAR4 archive. The `RarVM.ExecuteCode` loop is intended to be bounded by `maxOpCount`, but jump instructions can bypass this limit when `setIP()` is called with a target instruction pointer greater than or equal to `codeSize`.\n\nAn unauthenticated attacker who can provide a RAR archive to an application using `Junrar.extract()` can cause the extraction thread to spin forever, consuming CPU and blocking the process. The issue is a denial of service vulnerability, not remote code execution.\n\n### Details\n\nThe root cause is in `src/main/java/com/github/junrar/unpack/vm/RarVM.java`.\n\n`setIP()` returns early when the target IP is outside the prepared VM program:\n\n```java\nprivate boolean setIP(int ip) {\n    if ((ip) >= codeSize) {\n        return (true);\n    }\n\n    if (--maxOpCount <= 0) {\n        return (false);\n    }\n\n    IP = ip;\n    return true;\n}\n```\n\nWhen `ip >= codeSize`, this branch:\n\n- does not update `IP`;\n- does not decrement `maxOpCount`;\n- returns `true`, so callers treat it as success.\n\nThe `VM_JMP` handler and the other jump-like handlers discard the return value of `setIP()` and immediately `continue` the main VM loop:\n\n```java\ncase VM_JMP:\n    setIP(getValue(false, mem, op1));\n    continue;\n```\n\nBecause of the `continue`, execution also skips the loop-end accounting:\n\n```java\nIP++;\n--maxOpCount;\n```\n\nAs a result, a VM program containing a single `VM_JMP` instruction can freeze both `IP` and `maxOpCount`:\n\n1. `IP` points to the `VM_JMP` instruction.\n2. The jump target resolves to `codeSize` or larger.\n3. `setIP()` returns before modifying `IP` or decrementing `maxOpCount`.\n4. The caller ignores the return value and continues.\n5. The same `VM_JMP` instruction is executed again forever.\n\n### Impact\n\nThis is a CPU denial of service vulnerability. Any application that uses junrar to extract untrusted RAR archives can have an extraction worker thread permanently blocked by a small crafted archive. In services that process uploads or attachments automatically, repeated submissions can exhaust worker capacity and degrade or stop archive-processing functionality.\n\nThe RAR VM does not provide native code execution, reflection, or process execution primitives, and Java array bounds checks prevent escaping the VM memory array. The expected security impact is availability only.",
  "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" : "com.github.junrar:junrar"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "7.6.1"
      } ]
    } ],
    "database_specific" : {
      "last_known_affected_version_range" : "<= 7.6.0"
    }
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/junrar/junrar/security/advisories/GHSA-h9h9-2rmf-rvhp"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/junrar/junrar/commit/687a09c42f46066447faa9179ee11314ad6d9afb"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/junrar/junrar"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/junrar/junrar/releases/tag/v7.6.1"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-835" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-10-15T20:09:47Z",
    "nvd_published_at" : null
  }
}