Junrar: RarVM VM_JMP maxOpCount bypass causes infinite CPU loop during RAR4 extractionGHSA-h9h9-2rmf-rvhp
HIGHFix: junrar/junrar@687a09cGHSA-h9h9-2rmf-rvhp is a high-severity (CVSS 7.5) CWE-835 vulnerability in com.github.junrar:junrar. A fix is available for com.github.junrar:junrar — see the affected versions and patch details below.
Exploitation Status
No confirmed exploitation observed yet
- CISA assesses this as automatable — exploitation doesn’t require manual, per-target effort, which raises the odds of mass scanning and opportunistic attacks.
- CISA’s own triage has not observed active exploitation or public proof-of-concept code for this CVE as of its last assessment.
Exploitation and automatability from CISA’s SSVC triage for GHSA-h9h9-2rmf-rvhp.
EPSS Exploitation Probability
Probability of exploitation in the next 30 days, from FIRST.org EPSS.
How urgent is this, really
GHSA-h9h9-2rmf-rvhp by exploitation likelihood (EPSS) against impact (CVSS). Outside the shaded patch-first corner.
Where this sits among everything scored
Of 394,803 CVEs with a current EPSS score, this one falls in the < 10% band (highlighted). Counts from FIRST.org, log-scaled.
Real-World Exposure
com.github.junrar:junrarReal-time download stats are indexed for npm and PyPI packages. This vulnerability affects Maven packages — download data is not available via public APIs for these ecosystems.
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 Packages
| Ecosystem | Package | Vulnerable range | Fix |
|---|---|---|---|
| ☕Maven | com.github.junrar:junrar | all versions | 7.6.1com.github.junrar:junrar:7.6.1 |
Detection & mitigation playbook
Open-source dependencyDetect
Scan your dependency tree (package-lock.json, pnpm-lock.yaml, requirements.txt, go.sum, etc.) for com.github.junrar:junrar, including transitive dependencies — a direct dependency you never call can still pull in a vulnerable version.
Fix
Update com.github.junrar:junrar to 7.6.1 or later, then make sure no transitive (indirect) dependency still pins the vulnerable range — O3 confirms GHSA-h9h9-2rmf-rvhp is resolved across your whole dependency graph.
Workarounds
Cap what an attacker can consume: apply request size, rate and timeout limits in front of the affected component, and run it with memory and CPU limits so exhaustion degrades one worker rather than the whole service.
Frequently Asked Questions
Is GHSA-h9h9-2rmf-rvhp in your dependencies?
Find it across Maven, including transitive dependencies.