Security updates

Steve - we would like to merge these changes into master.  They shouldn't cause any major problems with the hub, but it would be good if you could give it a once over before merging.