Sep 17, 2026·8 min read·8 visits
Junrar versions before 7.6.1 are vulnerable to a directory traversal flaw allowing unauthorized directory creation via crafted archive entries.
A directory traversal vulnerability exists in the Junrar archive extraction library prior to version 7.6.1. When extracting crafted RAR archives, the library allows unauthorized directory creation outside the designated destination root due to improper path normalization during directory creation.
CVE-2026-86071 designates a directory traversal vulnerability in Junrar, an open-source Java library utilized for reading and extracting RAR archives. The vulnerability exists within the extraction pipeline, specifically inside the component responsible for creating localized file structures on the filesystem. When processing a RAR archive containing specialized entry filenames, the library fails to restrict directory creation to the intended extraction root directory.
This security flaw belongs to the class of CWE-22 (Improper Limitation of a Pathname to a Restricted Directory). The attack surface is exposed to any application that accepts untrusted RAR files and uses Junrar to extract them. Typical deployment scenarios include automated mail attachments scanners, file upload portals, and backup restoration services running in enterprise environments.
While traditional path traversal vulnerabilities permit attackers to write arbitrary files or execute code, this specific vulnerability is bounded by a logical validator. The filesystem writes are restricted to directory creation operations, as final file creations undergo subsequent canonicalization checks. Consequently, the operational impact is restricted to directory creation, directory structure pollution, and service disruption via directory squatting.
This issue was addressed in the 7.6.1 release of the library on July 21, 2026. Security teams are advised to review downstream dependencies to identify usage of affected Junrar versions.
The root cause of CVE-2026-86071 lies in a logical discrepancy between the initial path validation phase and the iterative directory creation process inside the LocalFolderExtractor class. To prevent arbitrary file writes outside the target sandbox, the library first verifies that the canonical path of the resolved file starts with the canonical path of the destination directory. This validation routine utilizes the getCanonicalPath() method to resolve symbolic links and relative path elements.
An attacker bypasses this verification check by designing a path containing relative traversal sequences that navigate out of the target sandbox and subsequently return to it. For example, a path structured as ../../extract_evil/../../destination/safe_file resolves canonicalization to /destination/safe_file when evaluated against the base directory. Because the canonicalized path starts with the destination directory, the path validation routine registers the path as safe and permits execution to continue.
Following validation, the library attempts to dynamically construct any missing parent directories by calling the makeFile method. This method processes the raw, unnormalized path string instead of the validated canonical path. It splits the string on the forward slash character to create an array of individual directory names, then sequentially iterates through this array to build and create each directory on the filesystem.
During this iterative assembly, the library sequentially appends each unnormalized directory segment—including relative sequences—to the destination path. The filesystem executes the mkdir() command on each resulting intermediate directory. Because these intermediate directories are not subjected to canonicalization checks or sandbox containment checks during this step, the library creates directories in locations outside the authorized destination boundary.
To examine the vulnerability, analyze the vulnerable implementation of the makeFile method inside LocalFolderExtractor.java. The vulnerable version uses string splitting and unnormalized string concatenation to create parent directories. The implementation is shown below:
// Vulnerable Code: LocalFolderExtractor.java
private File makeFile(final File destination, final String name) throws IOException {
final String[] dirs = name.split("/");
String path = "";
final int size = dirs.length;
if (size == 1) {
return new File(destination, name);
} else if (size > 1) {
for (int i = 0; i < dirs.length - 1; i++) {
// Concatenating unnormalized traversal sequences directly
path = path + File.separator + dirs[i];
File dir = new File(destination, path);
dir.mkdir(); // Executes mkdir on unvalidated path segments
}
path = path + File.separator + dirs[dirs.length - 1];
final File f = new File(destination, path);
f.createNewFile();
return f;
} else {
return null;
}
}The vulnerability is mitigated in commit e6e333b195a1e3ad271a18fd79d8ac1eb5289343 by adopting standard Java NIO.2 APIs. This modern approach resolves paths logically before any physical directory operations occur on the local filesystem. The patched implementation is presented below:
// Patched Code: LocalFolderExtractor.java
private File createFile(final FileHeader fh, final File destination) throws IOException {
// ... (validation logic) ...
if (!f.exists()) {
try {
// Call normalize() to collapse redundant relative path components
f = makeFile(f.toPath().normalize());
} catch (final IOException e) {
logger.error("error creating the new file: {}", f.getName(), e);
}
}
return f;
}
private File makeFile(final Path file) throws IOException {
if(file.getParent() == null) return null;
// Securely creates directories using normalized path structure
Files.createDirectories(file.getParent());
return file.toFile();
}The replacement of the manual loop with f.toPath().normalize() ensures that all redundant path segments, such as . and .., are resolved syntactically prior to directory creation. If the input contains traversal elements, the normalize() method resolves the path to its clean absolute representation. Consequently, Files.createDirectories() only acts on the legitimate destination directory structure, leaving no opportunity for intermediate directories to escape the sandbox.
Exploitation of CVE-2026-86071 requires the creation of a malformed RAR archive containing a specifically structured directory path. An attacker must construct an entry where the path moves outward from the intended root folder and then pivots back inward. The structure requires matching traversal steps to balance the final path and ensure it starts with the valid destination directory when canonicalized.
An attacker begins by identifying a target folder to create on the host system, such as /tmp/malicious_dir. Assuming the target extraction directory is /var/app/storage/extract, the attacker designs a relative path like ../../../../tmp/malicious_dir/../../../../var/app/storage/extract/valid_file.txt. The application must receive this archive file through an exposed ingestion vector, such as an HTTP file upload interface or an email processing queue.
When the victim application extracts the archive, the validation logic compares the canonical form of the target file path against the expected root directory. Because both resolve within the authorized boundary, validation is successful. However, during the sequential creation of the directory tree, the application issues filesystem commands to create the intermediate directory /tmp/malicious_dir. This occurs without raising an application-level exception, allowing the overall extraction process to complete silently.
While standard security tooling may flag plain traversals, nested loop traversals that resolve back into the sandbox often bypass basic static signature checks. This increases the probability of successful exploitation if input checking depends entirely on end-state canonical validation.
The security impact of CVE-2026-86071 is assessed as low, with a CVSS v3.1 base score of 3.7. The vector string is CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N. Because the vulnerability does not allow arbitrary file writes or arbitrary code execution, the direct compromise of system confidentiality and availability is prevented.
Despite the low severity score, the ability to create arbitrary directories poses operational risks in specific environments. An attacker can perform directory squatting or pre-create directories that are expected to be private or owned by other processes. On shared host configurations, directory creation can disrupt existing storage mappings, fill up local inode tables, or trigger logical errors in other processes that monitor filesystem changes.
Furthermore, directory creation can be used in multi-stage exploitation scenarios. For example, if another system service relies on the non-existence of a specific folder to perform an installation or initialization routine, pre-creating that folder can disrupt the service or alter its logical flow. There is currently no evidence of active exploitation of this vulnerability in the wild, and it is not listed in CISA's Known Exploited Vulnerabilities catalog.
This is not a traditional Zip Slip vulnerability because files themselves cannot be written outside the target directory, making it a unique logical variant of CWE-22.
The definitive remediation for this vulnerability is to upgrade the Junrar dependency to version 7.6.1 or later. This version replaces the legacy directory-creation logic with secure Java NIO.2 APIs that perform proper path normalization. Development teams using Maven should update their project configuration to reference the secure dependency version:
<dependency>
<groupId>com.github.junrar</groupId>
<artifactId>junrar</artifactId>
<version>7.6.1</version>
</dependency>If upgrading the library is not immediately feasible, developers must implement manual input sanitization. This involves analyzing the filenames of archive entries before invoking the Junrar extraction methods. Applications should reject archives containing filenames that include relative path segments like .. or those containing backslash characters that function as path separators on specific operating systems.
Security teams can monitor for exploitation attempts by inspecting application logs for anomalous directory creation patterns or directory-related exceptions. Additionally, file integrity monitoring solutions can be configured to detect unauthorized directory creation events occurring outside the expected sandbox directories. Regular scanning of software bills of materials will identify older versions of the Junrar library and flag them for remediation.
CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N| Product | Affected Versions | Fixed Version |
|---|---|---|
Junrar Junrar | < 7.6.1 | 7.6.1 |
| Attribute | Detail |
|---|---|
| CWE ID | CWE-22 |
| Attack Vector | Network (AV:N) |
| CVSS Score | 3.7 (Low) |
| Exploit Status | PoC (Proof of Concept) |
| KEV Status | Not Listed |
The product uses external input to construct a pathname that is intended to identify a file or directory that is located underneath a restricted directory, but the product does not properly neutralize security-sensitive elements within the pathname that can cause the pathname to resolve to a location that is outside of the restricted directory.
CVE-2026-72819 is a high-severity Remote Code Execution (RCE) vulnerability in Grav CMS before version 2.0.13. The vulnerability lies in the validation of dynamic data providers (callbacks) within the Flex Objects plugin settings and blueprints, allowing administrative users to bypass validation checks via array-notation callables. This validation failure enables administrative users to execute arbitrary PHP classes and methods, including the GPM Installer unZip routine, leading to full remote code execution on the server.
Steeltoe, a popular framework for building cloud-native .NET applications, contains a critical data-exposure flaw in its HttpExchanges actuator endpoint before version 4.3.0. When explicitly configured to include query strings, the system records and stores sensitive values (such as OAuth tokens and credentials) in memory and application debug logs without sanitization, exposing them to unauthorized network actors.
A logic verification vulnerability in `@libp2p/peer-store` (part of the `js-libp2p` ecosystem) allows unauthenticated remote attackers to bypass identity verification and poison a victim node's peer store database with arbitrary network multiaddresses. This occurs because `consumePeerRecord()` fails to ensure that the signature's identity matches the inner record payload's identity.
Improper neutralization of input during web page generation in Grav CMS allows authenticated users with page modification privileges to execute stored Cross-Site Scripting (XSS) attacks. The flaw exists in AudioMediaTrait and VideoMediaTrait where media source URLs are concatenated directly into HTML templates without proper escaping.
CVE-2026-63506 is a critical authorization bypass vulnerability in TinaCMS self-hosted backend authentication packages (@tinacms/auth and next-tinacms-azure). By exploiting a request-controlled clientID parameter, unauthenticated attackers with an active token for any developer-registered TinaCloud application can bypass tenant boundaries and execute unauthorized administrative operations, including full GraphQL database interactions and arbitrary media management.
CVE-2026-85078 describes a critical request-boundary integrity vulnerability (HTTP Request Smuggling) in Sanic, an open-source high-performance Python web server and framework. The vulnerability exists within Sanic's core HTTP/1.1 chunked-body parser. Prior to the patched versions, when processing a chunked transfer-encoded request, Sanic's parser failed to fully consume or validate the trailer-part following the terminating zero-size chunk.