flutter_secure_storage icon indicating copy to clipboard operation
flutter_secure_storage copied to clipboard

iOS: stored values are persisted even after app was removed

Open rexmihaela opened this issue 1 year ago • 3 comments
trafficstars

Repro steps:

  1. Make sure you have only one bundle/flavor of the app on the device.
  2. Store some key-value pair, like authToken
  3. Remove the app
  4. Install a fresh copy of the app
  5. The stored value is somehow accessible

rexmihaela avatar Dec 06 '23 01:12 rexmihaela

Check here: https://github.com/mogol/flutter_secure_storage/issues/125

vicenterusso avatar Dec 06 '23 01:12 vicenterusso

It's the expected behavior of iCloud Keychain. It's kind of like a password manager where each app has its own private space.

If you want to delete, you can run a delete function from the app which deletes everything.

kevtechi avatar Dec 21 '23 11:12 kevtechi

Going by this StackOverflow answer https://stackoverflow.com/questions/42903633/store-item-in-ios-keychain-without-icloud-sync/42903918#42903918 and this block of code in the iOS plugin code:

let update: [CFString: Any?] = [
  kSecValueData: value.data(using: String.Encoding.utf8),
  kSecAttrAccessible: attrAccessible,
  kSecAttrSynchronizable: synchronizable
]

anything stored via FlutterSecureStorage should not be synchronized with iCloud (by default). As the flag defaults to false.

Maybe I'm reading this wrong or maybe it't not working as intended. The "solution" to manually remove all keys depending on some arbitrary flag seems rather hacky.

lyio avatar Jun 18 '24 14:06 lyio

Since this is still default behavior, i am closing this issue.

juliansteenbakker avatar Aug 13 '24 20:08 juliansteenbakker