diff --git a/CHANGES.rst b/CHANGES.rst index 8b84e3e64..5b3c5e87d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,9 @@ There's a frood who really knows where his towel is. 1.1b2 (unreleased) ^^^^^^^^^^^^^^^^^^ +- Implement CSRF protection (closes `#590`_). + [rodfersou] + - Handle `AssertionError` on upgrade step to profile 13 to avoid failures when a cover object has duplicated tiles on it. Now, an error message will be logged and the object will be skipped; you must manually remove the duplicated tiles (closes #619). @@ -86,4 +89,5 @@ Previous entries can be found in the HISTORY.rst file. .. _`#578`: https://github.com/collective/collective.cover/issues/578 .. _`#581`: https://github.com/collective/collective.cover/issues/581 .. _`#584`: https://github.com/collective/collective.cover/issues/584 +.. _`#590`: https://github.com/collective/collective.cover/issues/590 .. _`#608`: https://github.com/collective/collective.cover/issues/608 diff --git a/buildout.cfg b/buildout.cfg index d67217f97..f9a787a39 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -18,6 +18,9 @@ parts += rebuild_i18n-sh robot +test-eggs += + plone4.csrffixes + [checkversions] recipe = zc.recipe.egg eggs = z3c.checkversions [buildout] diff --git a/src/collective/cover/browser/templates/compose.pt b/src/collective/cover/browser/templates/compose.pt index 22e8a999f..2717580cb 100644 --- a/src/collective/cover/browser/templates/compose.pt +++ b/src/collective/cover/browser/templates/compose.pt @@ -34,6 +34,31 @@ tal:replace="structure layout/render_compose" />
+ + + FIXME + BBB + plone4.csrffixes automatically adds, to all AJAX calls, + a X-CSRF-TOKEN so plone.protect will automatically add + CSRF protection without configuration, because from + plone.protect 3.0.x onwards it checks for this token. + + But for Plone 5 (that doesn't use + plone4.csrffixes for obvious reasons) this token isn't + set, so you need to add a form to all your templates + and an _authenticator variable to all your requests in + your javascripts. + + If this issue of adding this behavior of setting the + token in + + https://github.com/plone/plone.protect/issues/42 + + is solved, these forms and all _authenticator variables + can be removed from code. + + +
diff --git a/src/collective/cover/browser/templates/layoutedit.pt b/src/collective/cover/browser/templates/layoutedit.pt index 11cf53cac..01a5d4d7a 100644 --- a/src/collective/cover/browser/templates/layoutedit.pt +++ b/src/collective/cover/browser/templates/layoutedit.pt @@ -69,7 +69,31 @@