Skip to content
Path traversal Write-up Intermediate

Files.app Symbolic Link Following

The iOS Files app did not properly handle symbolic links that point outside the intended folder, allowing an attacker to extract sensitive directories such as app data and iCloud Drive. An attacker could trick a user into sharing a symlink via AirDrop or iCloud, which would then send the contents of the linked folder.

Ron Masas Follow

Published on breakpoint.sh

In this post, I'm going to go over how a simple symbolic link could have been used to extract the entire /private/var/mobile/Containers/ folder. This folder contains, among other things, iOS applications data, usually in the form of an unencrypted database.

Ron Masas (@RonMasas), on breakpoint.sh

The full write-up lives on its author's site

It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.

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

How it worked

Impact

An attacker could extract sensitive folders like app data and iCloud Drive from an unlocked device, but iOS 15 limited the impact to only 'File Provider Storage' and 'Mobile Documents' folders.

What the attacker needed

Unlocked iOS device; attacker can send a file to the device; victim shares the symlink back

The fix

The issue was fixed in iOS 15.4.

How it was found

  1. Create a symbolic link to a sensitive folder and package it into a zip file.
  2. Transfer the zip file to the iOS device (e.g., via AirDrop) and extract it.
  3. Navigate to the extracted folder and open the symlink file.
  4. Tap the share icon and share the file via AirDrop.
  5. The shared file is actually the linked folder, which gets zipped and sent.

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 write-up has not been written yet. The Original tab links to the source.

A symbolic link (symlink) is like a shortcut that points to another file or folder. The Files app on iOS did not check where a symlink pointed, so if you shared a symlink, it would share the folder it pointed to instead. This let an attacker get access to private folders like app data or iCloud Drive.

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 Ron Masas

View all

5 more disclosed reports, best first.

More from Apple

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.