Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8422483
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T03:27:36+00:00 2026-06-10T03:27:36+00:00

I am trying for protecting against XSRF attacks GWTP app. The problem facing like

  • 0

I am trying for protecting against XSRF attacks GWTP app. The problem facing like JSESSION easliy get in paroz testing tool, using that tools if user is already logged in and at the same time made same server request by paroz. it execute same transaction with updated value, which is a security problem.

To stop that one, Required to create per request new cookie and send from client to server.

@SecurityCookie
public static final String securityCookieName = getRandomString(); //Not work

For ClientModule

public class ClientModule extends AbstractPresenterModule {

    @Override
    protected void configure() {

        bindConstant().annotatedWith(SecurityCookie.class).to(
                NameTokens.securityCookieName);

And in DispatchServletModule

public class DispatchServletModule extends ServletModule {

    @Override
    public void configureServlets() {
        bindConstant().annotatedWith(SecurityCookie.class).to(NameTokens.securityCookieName);

I want to generate cookie randomally instead of ‘JSESSIONID’. How/where to do? And what is a proper way to regenerate cookie per request in GWTP?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T03:27:38+00:00Added an answer on June 10, 2026 at 3:27 am

    For generic gwt, see XSRF protection

    It’s for RPC calls:

    RPC XSRF protection is built using RpcToken feature, which lets a
    developer set a token on a RPC endpoint using HasRpcToken interface
    and have that token included with each RPC call made via that
    endpoint.

    You have to rewrite your rcp calls to be invoked in the callback that obtained the token but it’s not so difficult to implement.

    EDIT

    I don’t understand the need for a randomized cookie name. For the standard GWT protection, you have to specify a set name:

    <context-param>
      <param-name>gwt.xsrf.session_cookie_name</param-name>
      <param-value>JSESSIONID</param-value>
    </context-param>
    

    The docs you cited for gwtp state explicitly:

    To protect your application against XSRF attacks, as described in
    Security for GWT Applications , you have to specify the name of the
    security cookie you want to use
    . Do this by binding a string constant
    annotated with @SecurityCookie both on the client and on the server.

    I think it doesn’t matter if the user is logged in. Malicious code can not read the JSESSIONID cookie (or whatever cookie you specify) and it needs the value of the cookie (sure it can send the cookie but that does nothing because malicious code need the value so it can calculate a unique token that you send every request). This is what the docs say:

    Default XSRF protection implementation derives XSRF token from a
    session authentication cookie by generating an MD5 hash of the session
    cookie value and using the resulting hash as XSRF token. This
    stateless XSRF protection implementation relies on the fact that
    attacker doesn’t have access to the session cookie and thus is unable
    to generate valid XSRF token

    So you do need to specify your cookie name in order to configure it to work, or GWT can not use the value of that cookie to generate the end point token that you obtain prior to every rpc call and include with every rpc call.

    So while I don’t think you need to implement your own XSRF protection since you are not using standard gwt, I do think you do need to follow the docs you cite to configure gwtp to use it’s implementation of xsrf protection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to make sure all my inputs are secure, protecting the server
Trying to figure out how I can do this properly. The print_r looks like
Trying to get a wildcard search to pick up on any text in org_name
I'm trying to figure out which is the safest strategy for protecting my (file-based)
Trying to get a login script working, I kept getting the same login page
Trying for hours to get a request token using Google OAuthGetRequestToken but it always
Im trying to develop a new FB App, however it seems they have changed
I have two simple POCO classes; I'm trying to get the MyY property below
I am trying to get the following to work Function AddService(id As Integer) As
I am trying to unzip a zipfile with password protection. I know there is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.