Fix to prevent cross-site request forgeries

Change based on patch by Chris Steipp.
Bug: 57025

Change-Id: I9248ab529a6c7b38fde4b975a41aff3a329f5f61