openbmc / phosphor-rest-server

REST server that transposes dbus interfaces to REST
Apache License 2.0
4 stars 11 forks source link

JSON response headers need XSS protection #29

Open joseph-reynolds opened 5 years ago

joseph-reynolds commented 5 years ago

The REST API HTTP responses are missing some security headers. This should be done even for JSON data per https://www.owasp.org/index.php/XSS_(Cross_Site_Scripting)_Prevention_Cheat_Sheet.

For example, https GET /${bmc}/xyz/openbmc_project/network/enumerate returns JSON data with HTTP response headers that do not include:

The fix is to add these headers to the HTTP response.