Backported security fixes for the Portal