After reports of deleted photos resurfacing years later following the installation of iOS 17.5, Apple released iOS 17.5.1 last week to address the issue. But what caused it in the first place? Thanks to some clever reverse engineering by researchers, we have a glimpse at the rare bug responsible.
9to5Mac Security Bite is exclusively brought to you by Mosyle, the only Apple Unified Platform. Making Apple devices work-ready and enterprise-safe is all we do. Our unique integrated approach to management and security combines state-of-the-art Apple-specific security solutions for fully automated Hardening & Compliance, Next Generation EDR, AI-powered Zero Trust, and exclusive Privilege Management with the most powerful and modern Apple MDM on the market. The result is a totally automated Apple Unified Platform currently trusted by over 45,000 organizations to make millions of Apple devices work-ready with no effort and at an affordable cost. Request your EXTENDED TRIAL today and understand why Mosyle is everything you need to work with Apple.
![](https://9to5mac.com/wp-content/uploads/sites/6/2024/01/Pasted_Image_1_2_24__5_39 PM.png?w=1024)
How photo deletion works BTS
When a user navigates to delete an image from the Photos library, the device moves it to the Recently Deleted album and actually deletes it 30 days later. Of course, a user can permanently delete any of these photos before the 30-day mark.
Behind the scenes, the file isn’t necessarily erased. Since the iPhone uses a NAND storage system, the device instead marks the corresponding memory location as available for new data to be written. So old data isn’t physically removed right away; it remains intact until overwritten.
The benefits of using NAND include fast read/write speeds, better energy efficiency, and the ability to recover deleted files. It’s a pretty good non-volatile storage system–unless, well, there’s a bug.
The bug
Using an old iPhone 13, researchers at Synacktiv reverse-engineered last week’s iOS 17.5.1 update, identifying changes in the DYLD shared caches by comparing IPSW files.
According to Synacktiv, the more significant changes between iOS 17.5 and iOS 17.5.1 happened in the PLModelMigrationActionRegistration_17000 function within PhotoLibraryServices. This function registers migration handlers that convert data from an older format to the latest version.
![](https://9to5mac.com/wp-content/uploads/sites/6/2024/05/Screenshot-2024-05-26-at-11.15.06 AM.png?w=1024)
Image: Synacktiv
![](https://9to5mac.com/wp-content/uploads/sites/6/2024/05/Screenshot-2024-05-26-at-11.10.20 AM.png?w=772)
Image: Synacktiv
Most significantly, Apple removed a code segment within the function tasked with scanning and re-importing photos from the file system. As a result, the system initiated a reindexing process for older files stored in the local file system, inadvertently adding them back to users’ galleries.
“Based on this code, we can say that the photos that reappeared were still lying around on the filesystem and that they were just found by the migration routine added in iOS 17.5. “The reason why those files were there in the first place is unknown,” says Synacktiv.
This aligns with the iOS 17.5.1 release notes, in which Apple stated that the bug was caused by “database corruption.”
Apple also told 9to5Mac last week that photos that weren’t entirely deleted from devices were not synced to iCloud Photos. The bug was local on devices. The company emphasized that this problem was rare and affected a small number of users.
More in this series
FTC: We use income earning auto affiliate links. More.
![](https://techcodex.com/wp-content/uploads/2023/11/stsmall507x507-pad600x600f8f8f8-9-e1701329771970.jpg)
Alex Mitchell is your go-to expert for all things mobile. With a passion for the latest smartphones, apps, and mobile innovations, Alex provides in-depth reviews, insightful analyses, and breaking news about the ever-evolving world of mobile technology. Stay connected with Alex to navigate the fast-paced realm of mobile devices.