CVE-2026-39973: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in iBotPeaches Apktool
Apktool is a tool for reverse engineering Android APK files. In versions 3.0.0 and 3.0.1, a path traversal vulnerability in `brut/androlib/res/decoder/ResFileDecoder.java` allows a maliciously crafted APK to write arbitrary files to the filesystem during standard decoding (`apktool d`). This is a security regression introduced in commit e10a045 (PR #4041, December 12, 2025), which removed the `BrutIO.sanitizePath()` call that previously prevented path traversal in resource file output paths. An attacker can embed `../` sequences in the `resources.arsc` Type String Pool to escape the output directory and write files to arbitrary locations, including `~/.ssh/config`, `~/.bashrc`, or Windows Startup folders, escalating to RCE. The fix in version 3.0.2 re-introduces `BrutIO.sanitizePath()` in `ResFileDecoder.java` before file write operations.
AI Analysis
Technical Summary
Apktool versions 3.0.0 and 3.0.1 contain a path traversal vulnerability in the resource file decoding component (ResFileDecoder.java). The vulnerability arose from the removal of the BrutIO.sanitizePath() function, which previously prevented directory traversal attacks. An attacker can craft an APK with '../' sequences in the resources.arsc Type String Pool, causing the tool to write files outside the intended output directory during the 'apktool d' decode operation. This can lead to arbitrary file writes to sensitive locations such as ~/.ssh/config or ~/.bashrc, potentially enabling remote code execution. The issue was corrected in version 3.0.2 by restoring the path sanitization call before file writes.
Potential Impact
Successful exploitation allows an attacker with the ability to decode a malicious APK using vulnerable Apktool versions to write arbitrary files to arbitrary locations on the filesystem. This can lead to overwriting critical user files, such as SSH configuration or shell startup scripts, which may escalate to remote code execution under the victim's user context. The vulnerability does not affect Apktool versions prior to 3.0.0 or versions 3.0.2 and later. No known exploits have been reported in the wild to date.
Mitigation Recommendations
Users should upgrade to Apktool version 3.0.2 or later, where the path traversal vulnerability is fixed by reintroducing the path sanitization function. Until upgrading, avoid decoding untrusted APK files with vulnerable versions 3.0.0 and 3.0.1. Patch status is confirmed by the vendor's fix in version 3.0.2. No additional mitigations are indicated by the vendor advisory.
CVE-2026-39973: CWE-22: Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal') in iBotPeaches Apktool
Description
Apktool is a tool for reverse engineering Android APK files. In versions 3.0.0 and 3.0.1, a path traversal vulnerability in `brut/androlib/res/decoder/ResFileDecoder.java` allows a maliciously crafted APK to write arbitrary files to the filesystem during standard decoding (`apktool d`). This is a security regression introduced in commit e10a045 (PR #4041, December 12, 2025), which removed the `BrutIO.sanitizePath()` call that previously prevented path traversal in resource file output paths. An attacker can embed `../` sequences in the `resources.arsc` Type String Pool to escape the output directory and write files to arbitrary locations, including `~/.ssh/config`, `~/.bashrc`, or Windows Startup folders, escalating to RCE. The fix in version 3.0.2 re-introduces `BrutIO.sanitizePath()` in `ResFileDecoder.java` before file write operations.
CVSS v3.1
Score 7.1high
Weaknesses
AI-Powered Analysis
Machine-generated threat intelligence
Technical Analysis
Apktool versions 3.0.0 and 3.0.1 contain a path traversal vulnerability in the resource file decoding component (ResFileDecoder.java). The vulnerability arose from the removal of the BrutIO.sanitizePath() function, which previously prevented directory traversal attacks. An attacker can craft an APK with '../' sequences in the resources.arsc Type String Pool, causing the tool to write files outside the intended output directory during the 'apktool d' decode operation. This can lead to arbitrary file writes to sensitive locations such as ~/.ssh/config or ~/.bashrc, potentially enabling remote code execution. The issue was corrected in version 3.0.2 by restoring the path sanitization call before file writes.
Potential Impact
Successful exploitation allows an attacker with the ability to decode a malicious APK using vulnerable Apktool versions to write arbitrary files to arbitrary locations on the filesystem. This can lead to overwriting critical user files, such as SSH configuration or shell startup scripts, which may escalate to remote code execution under the victim's user context. The vulnerability does not affect Apktool versions prior to 3.0.0 or versions 3.0.2 and later. No known exploits have been reported in the wild to date.
Mitigation Recommendations
Users should upgrade to Apktool version 3.0.2 or later, where the path traversal vulnerability is fixed by reintroducing the path sanitization function. Until upgrading, avoid decoding untrusted APK files with vulnerable versions 3.0.0 and 3.0.1. Patch status is confirmed by the vendor's fix in version 3.0.2. No additional mitigations are indicated by the vendor advisory.
Technical Details
- Data Version
- 5.2
- Assigner Short Name
- GitHub_M
- Date Reserved
- 2026-04-08T00:01:47.627Z
- Cvss Version
- 3.1
- State
- PUBLISHED
- Remediation Level
- null
Threat ID: 69e6d6dd19fe3cd2cd64f727
Added to database: 4/21/2026, 1:46:05 AM
Last enriched: 4/28/2026, 5:47:44 AM
Last updated: 6/5/2026, 8:06:03 AM
Views: 100
Community Reviews
0 reviewsCrowdsource mitigation strategies, share intel context, and vote on the most helpful responses. Sign in to add your voice and help keep defenders ahead.
Want to contribute mitigation steps or threat intel context? Sign in or create an account to join the community discussion.
Actions
Updates to AI analysis require Pro Console access. Upgrade inside Console → Billing.
Need more coverage?
Upgrade to Pro Console for AI refresh and higher limits.
For incident response and remediation, OffSeq services can help resolve threats faster.
Latest Threats
Check if your credentials are on the dark web
Instant breach scanning across billions of leaked records. Free tier available.