Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Note: This vulnerabilility has been fixed.

Problem

Problem

...

See: 

Jira
serverMagnolia - Issue tracker
keyMAGNOLIA-5807

...

Referer header example: Referer: http://demoauthor45.magnolia-cms.com/.magnolia/trees/website.html?mgnlCK=1404726339576

Status

We started work on and have a basic implementation of the token method (see above ticket) but are concerned that too many things must be changed to implement it, and that this could cause problems for existing magnolia installations. So we decided to spend some more time researching the "referer-check" approach to see if this is feasible.

Conclusion after 4 hours research

Referer checking should work against known exploits if written correctly. The four downsides i see are:

...

How to support existing installation: WhiteList? Special Code? Tokens??!?

Should it be possible to configure a white list of additional referrers? Perhaps some integrations would like to make direct requests from external servers, or would this be introducing too great of a vulnerabilty?

Research

OWASP Page: Investigate Referrer Method

https://www.owasp.org/index.php/Cross-Site_Request_Forgery_(CSRF)_Prevention_Cheat_Sheet#Checking_The_Referer_Header

...

  • "For example, open redirect vulnerabilities can be used to exploit GET-based requests that are protected with a referer check"
  • "and some organizations or browser tools remove referrer headers as a form of data protection."
    • That individual or organization would have sacrafice their privacy in this case.
  • "There are also common implementation mistakes with referer checks. For example if the CSRF attack originates from an HTTPS domain then the referer will be omitted. In this case the lack of a referer should be considered to be an attack when the request is performing a state change."
    • True browsing from an HTTPS page to a HTTP page strips the referer header by design (spec).
    • We simply consider all requests with no referrer to be an attack.
  • "For example, if the victim's domain is "site.com" then an attacker have the CSRF exploit originate from "site.com.attacker.com" which may fool a broken referer check implementation. XSS can be used to bypass a referer check."
    • OK. we just need a good check, ie last part of the host.

Notes

Privacy

Quote from the HTTP spec:
"
Because the source of a link might be private information or might reveal an otherwise
private information source, it is strongly recommended that the user be able to
select whether or not the Referer field is sent. For example, a browser client could
have a toggle switch for browsing openly/anonymously, which would respectively
enable/disable the sending of Referer and From information.
"

...

http://smerity.com/articles/2013/where_did_all_the_http_referrers_go.html


New review by Topher 2018-04-09

There are continuing client requests for improved CSRF security:

Jira
serverMagnolia - Issue tracker
serverId500b06a6-e204-3125-b989-2d75b973d05f
keyMAGNOLIA-6865

Recommendation

I think that we should implement synchronizer-token authentication on Magnolia admincentral, in addition to the existing referer checks, in order to be in compliance with the recommendations by OWASP (See Owasp recommendations.) , and to match the established best-practice in the enterprise CMS space. 

Research of the Referer check

I have researched Referer based security again.

The one problem that appears legit to me is that of a "replay attack" - a request that was intended to only be made once could be triggered multiple times, which could result in unexpected, unwanted changes to content. Our current protection would not stop that.

There are four common objections to relying on referer-check alone - but I don't find the reasons convincing.

  • Incorrect referer check: "There are also common implementation mistakes with referer checks." I think that we have satisfactorally avoided the mistakes. (But hard to convince someone of that - or prove it.)
  • No referer header set: Request may not have a referer header set. We simply do not allow them access, which is acceptable for our use-case.
  • Browser support: Previously, not all browsers protected the referer header properly. Now they do. Its possible that someone has installed a browser extension/plugin that does something strange, but I dont think we need to cover that case. (We could add this to our browser support page)
  • Doesnt always work: There are many quotes like this "Referer checking can detect some attacks but not stop all attacks", but after much searching I find no reference to anything besides the above items - in other words things that are not a problem for us. I have seen no indication that a referer can be spoofed in a CSRF context.

Competitor research

Most of our competitors rely on the synchrnonizer-token approach. 

The following CMS that I checked all support Token based authentication:

(As far as I can tell it is for their admin interface - but could be referring to the public website in some cases.)

For these I could find no clear information.

  • Coremedia
  • Drupal

I also found several indications that the token check was something that they have added relatively recently. For example AEM had referer check before and then added the token check.

Security Software

Also security scanning software is apparently looking for CSRF tokens on forms.

Ive seen these two mentioned.

Conclusion

Based on the above, I think it is most important that Magnolia is percieved well and adheres to the established best practices. While our referal protection is good, it is not generally accepted and therefore will be mistrusted in many secuirty audits. In brief - many customers and potential customers will trust the OWASP page more that they will trust our reassurances that our system is secure.