I'm currently working on a website created with Apache Wicket and we're looking to enhance its security by implementing CSRF protection. Our goal is to keep it stateless by using a double submit pattern.
For forms, we are planning to include a hidden field that will store the csrf token.
However, we also need to apply this to some GET requests triggered by an AjaxFallbackLink which updates data (even though it's not ideal, changing it isn't an option right now). One approach we're considering is placing the CSRF token in a custom header sent along with the request. Yet, I haven't found a way to intercept the javascript method used by wicketAjaxGet (which seems to only accept a precondition function and a channel function). Any suggestions on how I can achieve this?
Alternatively, would embedding the token in the URL be a viable solution? What potential drawbacks might arise from this approach compared to setting it in the header, given that we're utilizing HTTPS for transmission?
Do you have any other ideas on how we could implement CSRF protection for these Ajax GET requests?