Package: plone4.csrffixes
plone4.csrffixesThe package aims to backport the auto CSRF implementation from Plone 5
to Plone 4.The reason this is necessary is because there are a lot of CSRF problem
with the ZMI that Zope2 will never be able to fix.Seehttps://plone.org/security/hotfix/20151006for more details.InstallationPlone 4.3, 4.2, 4.1 and 4.0addplone4.csrffixesto eggs list:eggs =
    ...
    plone4.csrffixes
    ...add a new version pin for plone.protect, plone.keyring and plone.locking:[versions]
...
plone.keyring = 3.0.1
plone.locking = 2.0.10
plone.protect = 3.0.21
...Plone 4.0 and 4.1If lxml is not already included in your site, this package has a dependency
on lxml and will pull it in when installed.We recommend pinning to version 2.3.6 of lxml. If you use a version of lxml > 3,
you’ll need to also install thecssselectpackage. Since version
1.0.4 we requirecssselectin oursetup.pyso it is
automatically installed.Additional addon versionsTo prevent some write on read errors that might cause false
positives with the auto csrf protection, these version pins have
been reported to work upgrading to:Products.CMFQuickInstallerTool = 3.0.12
Products.PlonePAS = 5.0.4For more version hints, seehttps://github.com/plone/plone4.csrffixes/issues/12.Robot frameworkplone4.csrffixes registers via z3c.autoinclude for Plone instances and is not
loaded in tests.You need to include plone4.csrffixes in your package configure.zcml for it to
load in your tests:<include package="plone4.csrffixes" />Still needed?Most patches in this package have been ported to their original location.
If you use Plone 4.3.8 or later, then it is sufficient to addplone.protect 3.0.21or higher.
With those versions, you may not needplone4.csrffixesanymore.But addingplone4.csrffixesmay still help avoid a few confirmation pages, because it has this code which is extra:It checks the referer.  If the previous page is within the Plone Site, no cross site checks are done.If the current page is a ZMI page (Zope Management Interface) all links are rewritten to have a CSRF token.Several other links get the CSRF token appended, for example in the Actions dropdown (Copy, Delete, etcetera).This extra code basically has no influence on the csrf checks.
But it allows some write-on-reads: situations where simply viewing a page, without submitting a form, already makes a change in the database.
A write-on-read is not wanted, but on Plone 4 it cannot always be avoided.
Some core code and also add-ons may do this.So the advice is:Try Plone 4.3.8 or higher withplone.protect3.0.21 or higherwithoutplone4.csrffixes.If that gives too many needless confirmation pages, then addplone4.csrffixesagain.Changelog1.1.1 (2019-01-08)Bug fixes:Updated documentation on versions and on the necessity of this package.  [maurits]1.1 (2016-08-26)New features:Depend onplone.protect 3.0.19or higher.  This addsprotect.js, so we do not have to do this anymore.  See issuehttps://github.com/plone/plone.protect/issues/42[maurits]Factor out referrer/origin backstop into its own method so it can be
customized on a subclassed transform.
[lgraf]Bug fixes:Change extension of CHANGES and README from txt to rst.
[gforcada]include a setup.cfg and a .editorconfig file with code conventions:
- settings for isort
- plone styleguide settings
[loechel]apply code conventions [loechel]1.0.9 (2015-11-18)fix potential issues with tinymce patch
[vangheem]Add documentation for loading plone4.csrffixes for robot framework testing
[lbrannon]1.0.8 (2015-10-30)Fix issue where redirects would contain an unparsable response
[vangheem]make plone lock operations safe
[vangheem]Check options before trying to work on them
[ale-rt]Use “application/javascript” media type instead of the obsolete “text/javascript”.
[hvelarde]1.0.7 (unreleased)Skipped by mistake.1.0.6 (2015-10-12)add a trailing slash on the site referrer matching
[vangheem]1.0.5 (2015-10-08)Handle TypeError caused by getToolByName on an
invalid context
[vangheem]1.0.4 (2015-10-07)add cssselect dependency for people who install lxml > 3
by mistake on Plone 4.0 and 4.1
[vangheem]1.0.3 (2015-10-07)prevent TypeError from occurring when checking commit of
non-string keys on an OOBTree instance. Fixes #5
[vangheem]Check to see if tinymce ajax is already patched or not.
This prevents JavaScript recursion error.
[awello, cekk]1.0.2 (2015-10-06)use a better guess at if we should rewrite urls
for zmi
[vangheem]1.0.1 (2015-10-06)correctly check for origin header
[vangheem]1.0.0 (2015-10-06)initial release