https://hackerone.com/reports/4779

Fix for https://hackerone.com/reports/4779