Currently I'm looking into secure automatic updates for a .net program I'm developing. I've asked on stackoverflow for people to review my approach to the update process here. In the process I've come across some interesting articles on automated updates and I thought I'd review how other applications go about it.
- Downloads http://java.sun.com/update/1.6.0/map-1.6.0.xml which has details of various updates:
- Then downloads the specific file given in the 'url' element (e.g: http://javadl-esd.sun.com/update/1.6.0/au-descriptor-1.6.0_15-b71.xml):
<information version="1.0" xml:lang="en">
<caption>Java Update - Update Available</caption>
<title>Java Update Available</title>
<description>Java 6 Update 15 is ready to install. Click the Install button to update Java now. If you wish to update Java later, click the Later button. To get a FREE copy of OpenOffice.org, the global standard in free, Microsoft compatible office productivity software, just click the More Information link below.</description>
<AlertTitle>Java Update Available</AlertTitle>
<AlertText>A new version of Java is ready to be installed.</AlertText>
<options>/installmethod=jau SP1OFF=1 SP2OFF=1 SP3OFF=1 SP5OFF=1 SP6OFF=1 SP7OFF=1 SP8OFF=1 SP10OFF=1 MSDIR=ms4 NEWMSTB=1 SPWEB=http://javadl-esd.sun.com/update/1.6.0/sp-1.6.0_15-b71</options>
- It does download a file from VeriSign which may be a check for the downloaded binary, e.g. http://ocsp.verisign.net/MFEwTzBNMEswSTAJBgUrDgMCGgUABBRODEXefhs%2FUZFum2o8YfzOFwceMwQUkz5j3yJ0BOBkhDHd2yOfDq%2B2TZMCEA89qsgV9niZmSI6gIO0S%2FU%3D
- Downloads http://getpaint.net/updates/versions.5.600.x86.en.txt which looks like this:
; 3.xx manifest
3.50.3550.40197_Name=Paint.NET v3.5 Beta 1 (Build 3550)
This manifest file and the associated binaries don't appear to be signed in any way. Update: Rick Brewster has commented to say that the downloaded binary is signed and the signature is verified.
- Checks for updates by querying: http://126.96.36.199/ui/0/188.8.131.52./en/getnewestversion?ver=184.108.40.206&uhash=143c299d62b6baac1f30936f72dd4683f
- Downloads the update file: http://163-158.static.quiettouch.com/ui/0/220.127.116.11./en/upgrade
- Unless the downloaded binary's signature is checked this would be vulnerable to a man in the middle attack.
- iTunes posts a big blob of data back to Apple on startup checking for updates - I didn't look into this much.
- Google Chrome also posts back information when checking for updates. My version of Chrome was up to date so I didn't see the update process in action.
- Firefox was already in the process of downloading a new version so I had already missed the file download negotiation.
It seems like everyone is doing automatic updates differently (no surprises there). It also looks like there is plenty of scope for man in the middle and spoofing attacks if the downloaded binaries aren't signed or don't have their signatures. It doesn't seem like many people are checking their manifest files before downloading binaries which could lead to Safari style "carpet bombing" where malicious binaries are downloaded onto the system.