{"id":"CVE-2026-86071","aliases":["EUVD-2026-81011","GHSA-89m4-43j5-vhhx"],"status":"published","title":"Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root","description":"Junrar is an open source Java RAR archive library. Prior to version 7.6.1, LocalFolderExtractor in src/main/java/com/github/junrar/LocalFolderExtractor.java can create directories outside the intended extraction root when processing a crafted archive entry. LocalFolderExtractor.createFile() validates only the final canonical file path, while LocalFolderExtractor.makeFile() creates intermediate path segments with unchecked mkdir() calls. An entry can therefore make the final path resolve inside the destination while causing intermediate directory creation outside it, enabling filesystem pollution or file-versus-directory squatting that can make later security-sensitive writes fail. The demonstrated impact is directory creation, not unconditional arbitrary file-content write. This issue is fixed in version 7.6.1.","severity":{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna","from":"cve"},"epss":{"day":"2026-11-10","score":0.00362,"percentile":0.30367,"model":"v2026.06.15"},"facts":{"in_kev":false,"known_exploited":false,"public_exploit":false,"fix_available":true},"cwes":["CWE-22"],"published":"2026-09-16T19:05:42Z","modified":"2026-10-28T11:18:56Z","fixes":[{"ecosystem":"Maven","package":"com.github.junrar:junrar","fixed_in":["7.6.1"],"sources":["ghsa","osv"]}],"affected":[{"source":"ghsa","ecosystem":"Maven","package":"com.github.junrar:junrar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"last_affected":"7.6.0"},{"fixed":"7.6.1"}]}]},{"source":"osv","ecosystem":"Maven","package":"com.github.junrar:junrar","ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"7.6.1"}]}],"versions":["0.7","1.0.0","1.0.1","2.0.0","3.0.0","3.1.0","4.0.0","5.0.0","6.0.0","6.0.1","7.0.0","7.1.0","7.2.0","7.3.0","7.4.0","7.4.1","7.5.0","7.5.1","7.5.10","7.5.2","7.5.3","7.5.4","7.5.5","7.5.6","7.5.7","7.5.8","7.5.9","7.6.0"]}],"products":[{"vendor":"junrar","product":"junrar"}],"references":[{"url":"https://github.com/junrar/junrar/security/advisories/GHSA-89m4-43j5-vhhx","tags":["x_refsource_CONFIRM","advisory","web"]},{"url":"https://github.com/junrar/junrar/commit/e6e333b195a1e3ad271a18fd79d8ac1eb5289343","tags":["x_refsource_MISC","fix","web"]},{"url":"https://github.com/junrar/junrar/releases/tag/v7.6.1","tags":["x_refsource_MISC","web"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2026-86071","tags":["advisory"]},{"url":"https://github.com/advisories/GHSA-89m4-43j5-vhhx"},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/86xxx/CVE-2026-86071.json","tags":["advisory"]},{"url":"https://github.com/junrar/junrar","tags":["package"]}],"sources":{"cve":[{"id":"CVE-2026-86071","title":"Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root","description":"Junrar is an open source Java RAR archive library. Prior to version 7.6.1, LocalFolderExtractor in src/main/java/com/github/junrar/LocalFolderExtractor.java can create directories outside the intended extraction root when processing a crafted archive entry. LocalFolderExtractor.createFile() validates only the final canonical file path, while LocalFolderExtractor.makeFile() creates intermediate path segments with unchecked mkdir() calls. An entry can therefore make the final path resolve inside the destination while causing intermediate directory creation outside it, enabling filesystem pollution or file-versus-directory squatting that can make later security-sensitive writes fail. The demonstrated impact is directory creation, not unconditional arbitrary file-content write. This issue is fixed in version 7.6.1.","status":"published","published":"2026-09-16T19:05:42.361Z","modified":"2026-09-17T19:25:35.128Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"cna"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T13:49:31.546614Z"}],"euvd":[{"id":"EUVD-2026-81011","description":"Junrar is an open source Java RAR archive library. Prior to version 7.6.1, LocalFolderExtractor in src/main/java/com/github/junrar/LocalFolderExtractor.java can create directories outside the intended extraction root when processing a crafted archive entry. LocalFolderExtractor.createFile() validates only the final canonical file path, while LocalFolderExtractor.makeFile() creates intermediate path segments with unchecked mkdir() calls. An entry can therefore make the final path resolve inside the destination while causing intermediate directory creation outside it, enabling filesystem pollution or file-versus-directory squatting that can make later security-sensitive writes fail. The demonstrated impact is directory creation, not unconditional arbitrary file-content write. This issue is fixed in version 7.6.1.","status":"published","published":"2026-09-16T19:05:42Z","modified":"2026-09-17T19:25:35Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"updated_at":"2026-11-02T17:28:10.042182Z"}],"ghsa":[{"id":"GHSA-89m4-43j5-vhhx","title":"Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root","description":"## 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 \u003c 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.","status":"published","published":"2026-09-17T16:30:46Z","modified":"2026-09-17T16:30:47Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:41:18.357514Z"}],"nvd":[{"id":"CVE-2026-86071","description":"Junrar is an open source Java RAR archive library. Prior to version 7.6.1, LocalFolderExtractor in src/main/java/com/github/junrar/LocalFolderExtractor.java can create directories outside the intended extraction root when processing a crafted archive entry. LocalFolderExtractor.createFile() validates only the final canonical file path, while LocalFolderExtractor.makeFile() creates intermediate path segments with unchecked mkdir() calls. An entry can therefore make the final path resolve inside the destination while causing intermediate directory creation outside it, enabling filesystem pollution or file-versus-directory squatting that can make later security-sensitive writes fail. The demonstrated impact is directory creation, not unconditional arbitrary file-content write. This issue is fixed in version 7.6.1.","status":"published","published":"2026-09-16T19:17:58.623Z","modified":"2026-09-24T21:25:27.05Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low","assessor":"secondary"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T14:12:48.630594Z"}],"osv":[{"id":"CVE-2026-86071","title":"Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root","description":"Junrar is an open source Java RAR archive library. Prior to version 7.6.1, LocalFolderExtractor in src/main/java/com/github/junrar/LocalFolderExtractor.java can create directories outside the intended extraction root when processing a crafted archive entry. LocalFolderExtractor.createFile() validates only the final canonical file path, while LocalFolderExtractor.makeFile() creates intermediate path segments with unchecked mkdir() calls. An entry can therefore make the final path resolve inside the destination while causing intermediate directory creation outside it, enabling filesystem pollution or file-versus-directory squatting that can make later security-sensitive writes fail. The demonstrated impact is directory creation, not unconditional arbitrary file-content write. This issue is fixed in version 7.6.1.","status":"published","published":"2026-09-16T19:05:42.361Z","modified":"2026-10-28T11:18:56.449780315Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:45:18.825071Z"},{"id":"GHSA-89m4-43j5-vhhx","title":"Junrar: LocalFolderExtractor mkdir escape allows directory creation outside extraction root","description":"## 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 \u003c 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.","status":"published","published":"2026-09-17T16:30:46Z","modified":"2026-09-17T16:45:06.345577098Z","cvss":[{"version":"3.1","score":3.7,"vector":"CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:N","level":"low"}],"cwes":["CWE-22"],"updated_at":"2026-11-02T15:46:42.077781Z"}]}}
