We are security testing Shiny Server and our test app was identified as having a problem. The problem was identified as "Cookie Security: HTTP Only Not Set." Looking at the attack response (see reference below), it appears that there are two Set-Cookie statements. One does not have httponly set and one does.
I've Google'd this, but can't seem to find anything definitive (in addition to not understanding most of the technical details). Seems like it may have to do with XSRF-TOKEN needing to be able to be read by JavaScript?
Cookies:
RStudio Server Pro uses HTTP only cookies except for the CSRF cookie.
Questions:
- Does Shiny Server set httponly by default?
- Why is httponly not set for the XSRF-TOKEN cookie?
Thanks for any input.
Reference:
<Attack Response per our security test>
HTTP/1.1 302 Found
X-Powered-By: Express
Set-Cookie: XSRF-TOKEN=[someshorthash]; Path=/
Set-Cookie: session_state=[somereallylonghash]; path=/; expires=Thu, 11 May 2017 08:07:04 GMT; httponly
Location: /apps/[secureappname]/
Vary: Accept
Content-Type: text/html; charset=utf-8
Content-Length: 82
Date: Thu, 11 May 2017 06:07:10 GMT
Connection: keep-alive