Skip to content
Path traversal Disclosed report Intermediate

Path traversal in ZIP extract routine on LINE Android

The LINE Keep feature in the Android app unzips files without validating entry names, allowing a malicious ZIP to write outside the intended directory. A pre-installed malicious app with storage permission can replace a memo with a crafted ZIP, and when the user opens it, files in LINE's private folders are overwritten.

kanytu Follow

Originally disclosed on HackerOne

Bounty$475 Medium 5.4 View original
  • Triaged in 8 days
  • Fixed in 3 months
  • Paid in 58 days
  • Disclosed after 7 months

Summary by the program

@kanytu discovered that LINE Keep(a file storage service in the LINE App) contains an unsafe unzipping pattern, which can potentially be exploited to launch Path traversal attack. The reporter proved that it can lead to overwriting files in the LINE app's private folders under certain conditions by providing a PoC Android application and clear explanations. Additionally, there was an issue of LINE storing data in external storage, which was a known issue prior to reporting and had been fixed.

The complete chain looks like this:

Pre-conditions:

LINE for Android provisioned with a valid account LINE for Chrome installed and configured with the same account as the device "Do not keep activities" setting has to be disabled A malicious Android application must be pre-installed on the victim's device and STORAGE permission is required. Steps to reproduce:

In LINE for Chrome, create a new Memo and add some text to it. Install the PoC Android application on the victim's device and grant STORAGE permission when requested Open LINE for Android and go to the "keep" account.

You can see the new note there, as a ZIP file. If not, pull to refresh. At this point, the PoC application tries to replace the original Memo file with a malicious ZIP file which contains an entry containing path traversal characters (“../”) in its name (e.g. ../../../../../../../data/data/jp.naver.line.android/files/something)

Tap your ZIP note and tap on it again to open the contents of the ZIP file

The LINE app will crash as part of a "SecurityException," but at this point, the files in the LINE app's private folders have already been overwritten.

The original report as published on HackerOne, by kanytu. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the ZIP extraction routine did not sanitise entry names, allowing path traversal sequences to escape the intended extraction directory.

Impact

An attacker can overwrite files in LINE's private folders under certain conditions; the app then crashes with a SecurityException.

What the attacker needed

LINE for Android with a valid account; LINE for Chrome with the same account; 'Do not keep activities' disabled; Malicious Android app pre-installed with STORAGE permission

How it was found

  1. Create a new Memo in LINE for Chrome and add text.
  2. Install the PoC Android app and grant STORAGE permission.
  3. Open LINE for Android and go to the Keep account to see the note as a ZIP.
  4. The PoC app replaces the original Memo file with a malicious ZIP containing a path traversal entry.
  5. Tap the ZIP note and tap again to open its contents.
  6. The LINE app crashes with a SecurityException, but private files have already been overwritten.

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When an app unzips a file, it should only write files inside the folder it created for that ZIP. Here, the app trusted the file names inside the ZIP, so a name containing '../' could make it write to other folders on the phone. A malicious app already on the phone could swap a note for a bad ZIP, and opening it would overwrite LINE's private files.

What is Path traversal?

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.

More by kanytu

View all

2 more disclosed reports, best first.

More from LY Corporation

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Path traversal and file inclusion

The lesson behind this report.

Input that builds a file path escapes the intended folder, reading or writing files the application should never touch.