CVE-2026-97370
Junrar: RarVM VM_JMP maxOpCount bypass causes infinite CPU loop during RAR4 extraction
Description
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:
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:
case VM_JMP:
setIP(getValue(false, mem, op1));
continue;
Because of the continue, execution also skips the loop-end accounting:
IP++;
--maxOpCount;
As a result, a VM program containing a single VM_JMP instruction can freeze both IP and maxOpCount:
IPpoints to theVM_JMPinstruction.- The jump target resolves to
codeSizeor larger. setIP()returns before modifyingIPor decrementingmaxOpCount.- The caller ignores the return value and continues.
- The same
VM_JMPinstruction 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.
Affected Maven artifacts (1)
| Artifact | Affected versions | Fixed in |
|---|---|---|
| com.github.junrar » junrar | < 7.6.1 | 7.6.1 |
Blast radius
72% of the dependent artifacts (1,950) still pull an affected version in their latest release.
| Depth | Dependent versions |
|---|---|
| Direct | 1,091 |
| 2 hops | 11,103 |
| 3 hops | 18,862 |
| 4 hops | 28,954 |
| 5 hops | 50,778 |
| 6 hops | 41,691 |
Most used dependents
- org.apache.camel.springboot » camel-core-starter558 usages
- org.apache.tika » tika-parsers480 usages
- org.apache.camel.springboot » camel-spring-boot-starter478 usages
- org.xwiki.platform » xwiki-platform-oldcore449 usages
- org.apache.camel.quarkus » camel-quarkus-maven-plugin302 usages
- org.apache.tika » tika-parsers-standard-package178 usages
- org.apache.camel.quarkus » camel-quarkus-package-maven-plugin152 usages
- org.apache.jmeter » ApacheJMeter_core149 usages
- org.opencms » opencms-core134 usages
- org.alfresco » alfresco-repository121 usages
- org.jahia.server » jahia-impl120 usages
- org.onehippo.cms7 » hippo-cms-api119 usages
- org.xwiki.platform » xwiki-platform-test-docker101 usages
- com.agentsflex » agents-flex-core96 usages
- fr.paris.lutece » lutece-core94 usages
Computed from the dependency graph of build 20261124.0621 (compile and runtime scopes, nearest version wins). Exclusions and dependency management in consuming projects are not applied, so dependents are potentially affected. When several artifacts are affected, a dependent version that pulls more than one of them is counted once per artifact.
References
| Package | junrar/junrar | github.com |
| Web | junrar/junrar advisory GHSA-h9h9-2rmf-rvhp | github.com |
| Web | junrar/junrar commit 687a09c | github.com |
| Web | junrar/junrar release v7.6.1 | github.com |
