So secure wow

@strzalek @nealharris @rudle @indspenceable @nehakarajgikar

backported what looked like security-related commits from 3-0-lts.