CVE-2026-86071: Junrar LocalFolderExtractor Mkdir Escape Allows Directory Vulnerability

LOW
Advisory Identifier: GHSA-89m4-43j5-vhhx
CVSS 3.7
CWE-22
Published
Advisory Summary

CVE-2026-86071 is a LOW (CVSS 3.7) localfolderextractor mkdir escape allows directory vulnerability (CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')) affecting Junrar libraries in the Maven ecosystem. The issue involves localfolderextractor mkdir escape allows directory creation outside extraction root. Remediation is available by upgrading affected packages to version 7.6.1.

CVE-2026-86071 at a Glance

CVE Identifier CVE-2026-86071
GHSA Identifier GHSA-89m4-43j5-vhhx
Severity LOW
CVSS v3.1 Base Score 3.7
CWE Classification CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal')
Affected Product Junrar
Package Ecosystem Maven
Published Date
Last Updated

Security Impact

CVSS: 3.7

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

Attack Vector Network (AV:N)
Attack Complexity High (AC:H)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Unchanged (S:U)
Confidentiality None (C:N)
Integrity Low (I:L)
Availability None (A:N)

How to Fix CVE-2026-86071

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-86071, 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-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal'), where the product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory. 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 `LocalFolderExtractor` validates only the final canonical file path before extraction. However, `makeFile()` creates intermediate directories one path segment at a time without checking whether each created directory remains inside the destination folder. A malicious RAR entry can make the final file path resolve inside the extraction destination, while causing intermediate `mkdir()` calls to create attacker-chosen directories outside the extraction root. This is an extraction root escape via unchecked intermediate directory creation. The default impact is directory creation outside the intended destination, not unconditional arbitrary file content write. ## Affected Code - `src/main/java/com/github/junrar/LocalFolderExtractor.java` - `createFile()` checks only the final canonical path. - `makeFile()` calls `dir.mkdir()` for each intermediate segment without containment checks. Relevant code flow: ```java private File createFile(final FileHeader fh, final File destination) throws IOException { String name = invariantSeparatorsPathString(fh.getFileName()); File f = new File(destination, name); String dirCanonPath = f.getCanonicalPath(); if (!dirCanonPath.startsWith(destination.getCanonicalPath() + File.separator)) { throw new IllegalStateException(...); } if (!f.exists()) { f = makeFile(destination, name); } return f; } private File makeFile(final File destination, final String name) throws IOException { final String[] dirs = name.split("/"); String path = ""; for (int i = 0; i < dirs.length - 1; i++) { path = path + File.separator + dirs[i]; File dir = new File(destination, path); dir.mkdir(); } path = path + File.separator + dirs[dirs.length - 1]; final File f = new File(destination, path); f.createNewFile(); return f; } ``` ## Impact An attacker who can supply a malicious RAR archive can create directories outside the intended extraction directory. This violates the expected extraction boundary and can be used for filesystem pollution or file-vs-directory squatting. For example, an attacker can create a directory at a path where a later security-sensitive file is expected, causing future writes to that path to fail.

CVE-2026-86071 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-86071?
CVE-2026-86071 is a security vulnerability in Junrar involving LocalFolderExtractor mkdir escape allows directory creation outside extraction root under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').
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-86071?
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-86071?
CVE-2026-86071 has a CVSS v3.1 base score of 3.7 (LOW) with vector string CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N.
What CWE is associated with CVE-2026-86071?
CVE-2026-86071 is classified under CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') (The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted parent directory, but the product does not properly neutralize special elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.).
How can I check Maven dependencies for CVE-2026-86071?
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-89m4-43j5-vhhx",
  "modified" : "2026-09-17T16:30:46Z",
  "published" : "2026-09-17T16:30:46Z",
  "aliases" : [ "CVE-2026-86071" ],
  "summary" : "Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root",
  "details" : "## Summary\n\n`LocalFolderExtractor` validates only the final canonical file path before extraction. However, `makeFile()` creates intermediate directories one path segment at a time without checking whether each created directory remains inside the destination folder.\n\nA malicious RAR entry can make the final file path resolve inside the extraction destination, while causing intermediate `mkdir()` calls to create attacker-chosen directories outside the extraction root.\n\nThis is an extraction root escape via unchecked intermediate directory creation. The default impact is directory creation outside the intended destination, not unconditional arbitrary file content write.\n\n## Affected Code\n\n- `src/main/java/com/github/junrar/LocalFolderExtractor.java`\n  - `createFile()` checks only the final canonical path.\n  - `makeFile()` calls `dir.mkdir()` for each intermediate segment without containment checks.\n\nRelevant code flow:\n\n```java\nprivate File createFile(final FileHeader fh, final File destination) throws IOException {\n    String name = invariantSeparatorsPathString(fh.getFileName());\n    File f = new File(destination, name);\n    String dirCanonPath = f.getCanonicalPath();\n    if (!dirCanonPath.startsWith(destination.getCanonicalPath() + File.separator)) {\n        throw new IllegalStateException(...);\n    }\n    if (!f.exists()) {\n        f = makeFile(destination, name);\n    }\n    return f;\n}\n\nprivate File makeFile(final File destination, final String name) throws IOException {\n    final String[] dirs = name.split(\"/\");\n    String path = \"\";\n    for (int i = 0; i < dirs.length - 1; i++) {\n        path = path + File.separator + dirs[i];\n        File dir = new File(destination, path);\n        dir.mkdir();\n    }\n    path = path + File.separator + dirs[dirs.length - 1];\n    final File f = new File(destination, path);\n    f.createNewFile();\n    return f;\n}\n```\n\n## Impact\n\nAn attacker who can supply a malicious RAR archive can create directories outside the intended extraction directory.\n\nThis violates the expected extraction boundary and can be used for filesystem pollution or file-vs-directory squatting. For example, an attacker can create a directory at a path where a later security-sensitive file is expected, causing future writes to that path to fail.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N"
  } ],
  "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-89m4-43j5-vhhx"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2026-86071"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/junrar/junrar/commit/e6e333b195a1e3ad271a18fd79d8ac1eb5289343"
  }, {
    "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-22" ],
    "severity" : "LOW",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-09-17T16:30:46Z",
    "nvd_published_at" : "2026-09-16T19:17:58Z"
  }
}