Secure WhatsApp found to not be completely eradicating chat transcripts

Posted:
in iPhone
The end-to-end encrypted WhatsApp service is leaving traces of previously deleted chats behind in device storage, making forensic retrieval possible through physical device access or a warrant served on Apple for an iCloud backup.




Security researcher Jonathan Zdziarski has discovered that the only way to truly purge chats made through the communications app, is to delete the app entirely. Zdziarski discovered that even after deletion, only the pointer to the chat on the app's database was removed, leaving the actual chat transcript intact until the OS and the app get around to over-writing the previously used location where the chat was stored.

Retrieval of deleted chats is performed similarly to how assorted undelete apps find accidentally deleted files.

Regardless of how much data has to be written to a block, flash media controllers process an entire block of flash media when it is writing -- even if it only needs to write to part of the block. A write to a completely empty block is faster, because the drive doesn't have to copy the partially-full block to a cache, and make the changes in cache before it completely overwrites the cell.

As a result, modern operating systems prioritize those sectors in the interest of speed. Sectors of a medium previously containing data are written to after any zeroed sectors are available, acerbating the issue with WhatsApp not truly erasing stored chats after user deletion.

Regardless of what's been re-written or retained, "the WhatsApp chat database gets?copied over from the iPhone during a backup, which means it will show up in your iCloud backup and in a desktop backup," according to Zdiziarsky. However, iCloud backups do not respect the iTunes setting, and are not encrypted.

While exploitation of the flaw isn't trivial, Zdziarski notes that anyone with physical access to a phone could create a backup with it, if they were granted access. Additionally, anyone with physical access to a computer with a stored backup could copy the backup, made easier by recovering a password for it from the Keychain.




Law enforcement could issue a warrant to Apple to obtain the unencrypted database as well, and feed it to existing forensic tools to obtain the deleted messages that still exist in the media. Furthermore, users can be legally compelled in some locations to submit user credentials in macOS to access stored Keychain passwords, getting at the iTunes backup that way.

Zdziarski also recommends that users periodically delete the application from a device, and reinstall it, which will completely clear the database and all its contents, which "appears to be the only way to flush out deleted records and start fresh."

The security researcher also suggests that the WhatsApp developers shift to Apple's encrypted CoreData routines.

Zdziarski has been delving into iOS security since the launch of the iPhone. He discussed in March 2016 how the FBI could retrieve data from the San Bernardino shooter's iPhone 5c. Additionally, he was the initial discoverer of a large amount of services being unencrypted on the second iOS 10 beta, after discovery of the system's kernel cache not being encrypted.

Comments

  • Reply 1 of 7
    RosynaRosyna Posts: 87member
    The fix would be for WhatsApp to either move to encrypted CoreData (as the article suggests) or, more simply, to just use the SQLite VACUUM command (https://www.sqlite.org/lang_vacuum.html) on the app tombstoning notification (https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html#//apple_ref/doc/uid/TP40007072-CH8-SW24) if any chats had been deleted.

    The latter fix is more likely to occur with WhatsApp because it's almost trivial to adopt.
    lostkiwi
  • Reply 2 of 7
    gatorguygatorguy Posts: 24,211member
    Rosyna said:
    The fix would be for WhatsApp to either move to encrypted CoreData (as the article suggests) or, more simply, to just use the SQLite VACUUM command (https://www.sqlite.org/lang_vacuum.html) on the app tombstoning notification (https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html#//apple_ref/doc/uid/TP40007072-CH8-SW24) if any chats had been deleted.

    The latter fix is more likely to occur with WhatsApp because it's almost trivial to adopt.
    Not specifically mentioned in AI's article:
    "
    Apple’s iMessage has this problem and it’s just as bad, if not worse. Your SMS.db is stored in an iCloud backup, but copies of it also exist on your iPad, your desktop, and anywhere else you receive iMessages. Deleted content also suffers the same fate."

    ration alrhonin
  • Reply 3 of 7
    RosynaRosyna Posts: 87member
    gatorguy said:
    Rosyna said:
    The fix would be for WhatsApp to either move to encrypted CoreData (as the article suggests) or, more simply, to just use the SQLite VACUUM command (https://www.sqlite.org/lang_vacuum.html) on the app tombstoning notification (https://developer.apple.com/library/ios/documentation/iPhone/Conceptual/iPhoneOSProgrammingGuide/StrategiesforHandlingAppStateTransitions/StrategiesforHandlingAppStateTransitions.html#//apple_ref/doc/uid/TP40007072-CH8-SW24) if any chats had been deleted.

    The latter fix is more likely to occur with WhatsApp because it's almost trivial to adopt.
    Not specifically mentioned in AI's article:
    "
    Apple’s iMessage has this problem and it’s just as bad, if not worse. Your SMS.db is stored in an iCloud backup, but copies of it also exist on your iPad, your desktop, and anywhere else you receive iMessages. Deleted content also suffers the same fate."
    Because Apple never says anything about being able to securely delete text messages.

    It's especially moot when you can get them from the carrier and there is no way to guarantee what happens on the other side (the person that sent it or received it) is doing with the text message.

    It is neither "just as bad" nor "worst".

    I guess it's important to note that only about 25% of the content in any one of Zdziarski's post is technically accurate. The rest is either FUD, wild guessing, or just paranoid weirdness for PR purposes. His unfounded paranoia has resulted in some very useful, very secure Xcode features getting removed because of the bad PR it generated for Apple, even though his claims were incorrect.
    edited July 2016
  • Reply 4 of 7
    Rosyna said:
    gatorguy said:
    Not specifically mentioned in AI's article:
    "
    Apple’s iMessage has this problem and it’s just as bad, if not worse. Your SMS.db is stored in an iCloud backup, but copies of it also exist on your iPad, your desktop, and anywhere else you receive iMessages. Deleted content also suffers the same fate."
    Because Apple never says anything about being able to securely delete text messages.

    It's especially moot when you can get them from the carrier and there is no way to guarantee what happens on the other side (the person that sent it or received it) is doing with the text message.

    It is neither "just as bad" nor "worst".

    I guess it's important to note that only about 25% of the content in any one of Zdziarski's post is technically accurate. The rest is either FUD, wild guessing, or just paranoid weirdness for PR purposes. His unfounded paranoia has resulted in some very useful, very secure Xcode features getting removed because of the bad PR it generated for Apple, even though his claims were incorrect.
    I'm a bit surprised at your assessment of Zdziarski's blog posts. He claims to have developed effective peer vetted digital forensics software currently in use in the legal system. He has made what seem to me as very cogent arguments regarding several issues surrounding the recent Apple vs FBI legal battle (San Bernardino.) The modest amount I've read of his blog seems neither weird, paranoid nor FUD inducing. 

    I'm even more surprised that Apple would remove Xcode features based on incorrect claims and/or unfounded paranoia. They're usually pretty thick-skinned when it comes to negative PR. Do you have evidence to back your assertions? I didn't realize his sphere of influence was strong and wide enough to affect the development of Apple's own software.
    edited July 2016 rhonin
  • Reply 5 of 7
    Mike WuertheleMike Wuerthele Posts: 6,861administrator
    gatorguy said:
    Not specifically mentioned in AI's article:
    "
    Apple’s iMessage has this problem and it’s just as bad, if not worse. Your SMS.db is stored in an iCloud backup, but copies of it also exist on your iPad, your desktop, and anywhere else you receive iMessages. Deleted content also suffers the same fate."
    It wasn't mentioned because it's not relevant to the topic of the article. WhatsApp promises utter absolute security, and eradication of deleted messages.

    iMessage does not.
  • Reply 6 of 7
    rhoninrhonin Posts: 60member
    gatorguy said:
    Not specifically mentioned in AI's article:
    "
    Apple’s iMessage has this problem and it’s just as bad, if not worse. Your SMS.db is stored in an iCloud backup, but copies of it also exist on your iPad, your desktop, and anywhere else you receive iMessages. Deleted content also suffers the same fate."
    It wasn't mentioned because it's not relevant to the topic of the article. WhatsApp promises utter absolute security, and eradication of deleted messages.

    iMessage does not.
    However Apple alludes to it.  
    Why is it the deeper I dig, the the more the "privacy" claims by Apple tends to resemble a house of sticks?

    gatorguy
  • Reply 7 of 7
    rhoninrhonin Posts: 60member

    Hopefully discoveries like this will drive better solutions.
Sign In or Register to comment.