1) The client class RpcRequestBuilder sets the following headers in the doFinish() method --
protected void doFinish(RequestBuilder rb) {
rb.setHeader(STRONG_NAME_HEADER, GWT.getPermutationStrongName());
rb.setHeader(MODULE_BASE_HEADER, GWT.getModuleBaseURL());
}
2) On the server side, the class AbstractRemoteServiceServlet defines the method getPermutationStrongName()..
protected final String getPermutationStrongName() {
return getThreadLocalRequest().getHeader(STRONG_NAME_HEADER);
}
3) Then, in RemoteServiceServlet, in the processCall() method, there is a check like this -
if (getPermutationStrongName() == null) {
throw new SecurityException("Blocked request without GWT permutation header(XSRF attack?)");
}
(3) is a bit confusing to me. It was definitely there in an older version of RemoteServiceServlet (I think GWT 1.6?). But the current "in-trunk" version of RemoteServiceServlet doesn't have that check. Instead, that check has been moved to another class RpcServlet, which has been marked as experimental.
GWT does seem to folllow the "use a custom header to prevent XSRF attack" techique. Question is - Is it enough?
--Sri