Configure the CSRF Tokens
XWiki refuses an action that changes something unless the request carries a secret token, whose lifetime is set in xwiki.properties.
Steps
Any action needing comment, edit, delete, admin or programming right is refused unless the request carries that token, so the protection is on without anything being configured and what is left to set is how long a token lives. The request it turns away is the cross-site request forgery that Attack Vectors describes.
- Stop the XWiki instance, open the xwiki/WEB-INF/xwiki.properties configuration file and set how long a token stays usable:
# Lifetime of a token, in hours. csrf.tokenLifetime = 24XWiki 18.9.0+ A token is accepted during its own period and during the one before it, so it stays usable for between one and two lifetimes. 0 stops them expiring at all, which leaves the authentication validation key as the only thing that changes them.
- Restart the XWiki instance and sign in.
- Confirm the check is in force, by asking for an action with a token that is deliberately wrong:
http://wiki.example.org/xwiki/bin/save/Sandbox/WebHome?form_token=wrong&content=testXWiki answers 401 and sends the browser to ?xpage=resubmit, which says why it refused:

FAQ
Why are the users of a cluster refused?
The token is derived from xwiki.authentication.validationKey, so nodes that do not share the same value compute different tokens and reject each other's. Authentication Parameters says where to set it.
Do the tokens survive a restart?
XWiki 18.9.0+ Yes. A token is derived from the validation key, the user and the current time period rather than stored, so only the period or the key changes it.
A form of my own is refused. What is it missing?
The form_token parameter. Anything that performs an action has to carry the current token, which the Developer Guide's security documentation shows how to obtain.