Is it necessary to use CSRF Protection when the application relies on stateless authentication (using something like HMAC)?
Example:
We've got a single page app (otherwise we have to append the token on each link:
<a href="...?token=xyz">...</a>
.The user authenticates himself using
POST /auth
. On successful authentication the server will return some token.The token will be stored via JavaScript in some variable inside the single page app.
This token will be used to access restricted URLs like
/admin
.The token will always be transmitted inside HTTP Headers.
There's NO Http Session, and NO Cookies.
As far as I understand, there should(?!) be no possibility to use cross site attacks, because the browser won't store the token, and hence it cannot automatically send it to the server (that's what would happen when using Cookies/Session).
Am I missing something?