5

If I write an app for iOS and it's accepted by the AppStore, how do I know if the app is actually the app I compiled and has not being substituted/altered by, say, a "Man in the middle" style interception/attack? Is there a way to do a checksum either after the fact or from inside the app itself?

14
  • 1
    Your app and all the resources are already signed and iOS won't let it run without verifying the signatures, why do you think you really need more than that?
    – Kevin
    Aug 19 '13 at 20:25
  • 1
    If you don't trust Apple, this exercise is pointless. They are running your program, if they want to get any information out of it, they can do it quite easily without touching your binary.
    – Kevin
    Aug 19 '13 at 20:37
  • 1
    @Kevin: I would appreciate greatly if you would work your comments in a more diplomatic and less presumptive sounding fashion, this being the Internet and all, whether or not You are right and especially if You are wrong.
    – xuinkrbin.
    Aug 19 '13 at 21:04
  • 4
    Apple doesn't need a keylogger to intercept the keystrokes, it controls the keyboard that tells you what the user is typing in the first place. Even if you were to write a custom keyboard, Apple's code is what is displaying it on the screen and telling you when and where the user tapped. All user interaction on an iDevice goes through Apple's code, period. If they want to intercept any data, they can and there's nothing you can do about it. Want to send or receive data from the server? Apple controls the network stack. Want to read or write to disk? Apple controls file i/o too.
    – Kevin
    Aug 19 '13 at 21:14
  • 1
    You will have access to your codebase while the app is in the store. You can periodically push updates, and you can use the logs to check and deliver key messages. nth
    – ICL1901
    Aug 20 '13 at 0:24
1

Actually, it turns out, when backing up to iTunes, the *.ipa file is copied from the iOS device. This file is simply a *.zip with a different extension. Using a tool like 7-zip allows One to examine the contents after the back up to iTunes. A checksum can be run on the individual components in this archive, verifying a lack of tampering.

4
  • The question remains, though - if you don't trust Apple to not tamper with your app, why would you want to distribute through them in the first place? Also, they can change the download at any time. So while you may publish to the App Store and download a copy to ensure it has not been tampered with, they could change the copy on the App Store the next week and you would have no idea.
    – tubedogg
    Aug 20 '13 at 1:57
  • A very good point. At least this way, however, One can know, to at least a certain extent, if such tampering took place.
    – xuinkrbin.
    Aug 20 '13 at 18:28
  • I appreciate a trust but verify stance in this case. Having an answer that explains a little more detail on code signing might be nice, but this implies you are checksumming (or using a hash or even checking the file bit for bit) components of the IPA as opposed to the entire package which clearly Apple signs as part of the distribution process after you submit an app.
    – bmike
    Sep 10 '13 at 22:00
  • how about a jailbroken device that uses a hacked version of your app? can you ever detect that from server with certainty? The hacked app could have a fake version of any integrity checks that you developed into it. Android has the SafetyNet mechanism, which can probably be hacked as well in a rooted device, but still, they offer something. does IOS offer something similar? Nov 23 '17 at 7:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .