# Path traversal in ZIP extract routine on LINE Android

LINE Keep's ZIP extractor honored ../ entry names, letting a malicious app swap a memo ZIP to overwrite files in LINE's private data directory.

- Payout: $475
- Severity: medium
- Program: LY Corporation
- Found by: kanytu
- Disclosed: 2020-11-17
- Write-up quality: 6/10
- Original: https://hackerone.com/reports/859469
- Library page: https://bugbountylibrary.com/r/h1%3A859469
- Tags: area:mobile domain:mobile impact:integrity kind:bounty platform:hackerone sev:medium tech:android technique:race-window vuln:path-traversal

**Target:** LINE Android app, LINE Keep ZIP extraction routine
**Root cause:** The ZIP extraction routine used entry names directly when writing files without sanitizing path traversal sequences, allowing entries like ../../../../data/data/jp.naver.line.android/files/something to escape the extraction directory.
**Steps:**
1. In LINE for Chrome, create a Memo with text; it syncs to LINE Keep as a ZIP.
2. Install PoC Android app with STORAGE permission on victim device.
3. PoC replaces the original Memo ZIP file with a malicious ZIP containing an entry named `../../../../../../../data/data/jp.naver.line.android/files/something`.
4. Open LINE for Android, go to Keep, pull to refresh to see the ZIP note.
5. Tap the ZIP note twice to open/extract contents.
6. App crashes with SecurityException but private files are already overwritten.
**How found:** Reporter noticed LINE Keep stores synced memos as ZIP files in external storage and that the app extracts them; hypothesized the extractor might not sanitize entry names, then built a PoC app to swap the ZIP and confirmed private-folder overwrite.
**Exploitation:** Attacker pre-installs a malicious app with STORAGE permission that races to replace the synced Memo ZIP in external storage with a crafted ZIP containing traversal entry names. When the victim opens the ZIP in LINE Keep, extraction writes attacker-controlled content to LINE's private data directory, overwriting files.
**Insight:** When a mobile app syncs server-side content to external storage and later extracts it, treat the on-disk archive as attacker-controlled: test ZIP entry names with ../ to see if extraction escapes into the app's private data dir.

