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.
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.
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
- Create a symbolic link to a sensitive folder and package it into a zip file.
- Transfer the zip file to the iOS device (e.g., via AirDrop) and extract it.
- Navigate to the extracted folder and open the symlink file.
- Tap the share icon and share the file via AirDrop.
- 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.