We’re writing a console app which is to be installed on client’s machines. It’s possible we’ll want to update an XML file used by the app. How can I ensure the file is downloaded safely from our servers, eg no malicious files instead?
I presume the app would call our API to get the latest version number. If its newer than what it has, it would download this XML file from the specified URL. However doesn’t this make it vulnerable to man in the middle attacks or similar? I want to ensure our app is not responsible for downloading a malicious file (eg could be a malicious exe file).
Any help/guidance would be appreciated!
You need to sign the XML file with a private key on your server, then verify it on the client with a public key embedded in your app.
This will only help if you have a secure mechanism to deliver the initial app with its public key (eg, HTTPS)