-
-
Notifications
You must be signed in to change notification settings - Fork 4
Are the csrf patches still needed on Plone 4.3.8? #19
Comments
Current answer: yes they are still needed. But: the |
I am reopening this question. Several fixes have been merged to plone.protect. Is plone4.csrffixes still needed? I have updated the docs with my latest knowledge: 78f5da1. Let's repeat the most important part here in this comment. If you use Plone 4.3.8 or higher with plone.protect 3.0.21 there is not much that would still need
So this blesses (or grudgingly accepts) lots of code that does a write-on-read, so on a GET request. Note that the extra code is in the plone4.csrffixes transform, which is executed before the plone.protect transform. So their goal is a bit different. Questions then are:
The referer check makes sense to me: if the previous page is on the same site, then by definition it is not a cross site request. The other two then seem unneeded. Or am I missing the point of a csrf check here? Aha: The real point may be: are we doing protection against csrf or protection against write-on-read? And with that point stated, I think it then boils down to:
Conclusion:
|
@vangheem What do you think? |
thanks! FYI @idgserpro |
Update plone.protect to 3.0.21. See: plone/plone4.csrffixes#19
I think I know the answer to this one, but let's ask it anyway. We can point others with the same question to this issue.
The biggest thing that plone4.csrffixes does, is it adds a dependency on plone.protect 3.x. Is it possible to ignore the plone4.csrffixes package on Plone 4.3.8 and in your buildout only add a version pin for plone.protect 3.x?
Let's see.
The pending Plone 4.3.8 has several updated packages, which means that most patches in plone4.csrffixes are no longer needed. I have checked all patches in
patches.py
and they are no longer needed as they have been included in the relevant packages. The patches then have the effect thatalsoProvides(request, IDisableCSRFFixes)
is called twice, but that is fine. The superfluous patches are not harmful.What is left, is the added transform. It blesses a few read-on-writes, adds
protect.js
, and protects ZMI urls. Without this, I at least see some errors in the logs for scales created when adding an image in TinyMCE, but everything seems to go fine anyway. The ZMI works fine as far as I see, but I may not be testing the 'right' forms or links.So I think the answer is: if you want the full csrf protection on Plone 4.3.8, updating plone.protect to the latest 3.x will work, but to avoid some corner cases you should still add plone4.csrffixes.
And even with that package, there may be other corner cases in Plone, and certainly in add-ons, where you will still get the confirmation page warning you about a possible csrf attack.
The text was updated successfully, but these errors were encountered: