Search code examples
securitycsrfcsrf-protection

are precautions against CSRF needed for view-only pages?


All the examples of CSRF exploits tend to be against pages which process the incoming request.

If the page doesn't have a form processing aspect do I need to worry about CSRF ?

The situation I'm looking @ :

  • the page in question contains sensitive data
  • as such users need to establish a session to view the page

... my understanding is that a malicious page will be able to redirect a client to this page by embedding a link to it, however since there's no action on the target to perform there's no harm that can result, right ?

There's no way for said malicious site can view the sensitive page, correct ?

Why I ask: I want the url to the page with sensitive data to have a 'simple' URL which allows people to email the link to other people (who will in turn need a session to view the page). The token-based solution I've seen for most CSRF solutions remove this possibility, and so I'd like to avoid them if possible.


Solution

  • In general, CSRF is independent from whether the request causes any side effects or not. The CWE describes CSRF (CWE-352) as follows:

    The web application does not, or can not, sufficiently verify whether a well-formed, valid, consistent request was intentionally provided by the user who submitted the request.

    So CSRF is a general request intention authenticity problem.

    However, although CSRF is not really feasible without any effects other than data retrieval as the same-origin policy restricts the attacker from accessing the response, the attacker could exploit another vulnerability to profit from retrieval-only requests as well and gain access to sensitive data.