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 6028669
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T04:46:28+00:00 2026-05-23T04:46:28+00:00

I have implemented a simple GWT application featuring a login service (LoginService) and a

  • 0

I have implemented a simple GWT application featuring a login service (LoginService) and a worker service (WorkerService). Both GWT-RPC. I have protected all services against XSRF by implementing GWT’s latest XsrfProtectedServiceServlet (see GWT Xsrf-Safe Sample Projetct).

Implementing this example, the session id is created in the JSP file, right when a page gets loaded. In that case even if the user does not log in.

Is this a correct approach? Or do I have to create the session id (setting the cookie) in the LoginService? But when implementing it that way, wouldn’t the LoginService itself be vulnerable to an XSRF attack?

Thanks,
Pascal

  • 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-05-23T04:46:28+00:00Added an answer on May 23, 2026 at 4:46 am

    First, a short recap of XSRF:

    • User surfs to some-attacker.com/evil.html
    • evil.html contains e.g. an <img> tag (or some JavaScript that submits a form POST, …) with the URL “www.your-nice-site.com/doSomeAction”
    • This makes the user’s browser automatically submit a GET or POST request to your site, and perform the action on the user’s behalf. Unfortunately, the user’s cookies for http://www.your-nice-site.com are also sent automatically with the request, so (and here’s the problem) if the user is logged in, the request arrives as fully authorized by the user at your server (that is, if your server doesn’t require an additional anti-XSRF token).

    Now it’s easy to see, that XSRF can’t be used to attack the login service itself, because at that point, the user isn’t authorized yet – the attacker would have to know the user’s credentials to perform a login. (If the user is already logged in, then calling the login service should do nothing! [*])

    Note: Of course, the attacker may employ other techniques to perform an attack for the user’s credentials, most notably: Phishing. Anti-XSRF measures cannot protect you against that.


    [*] If you have services that cannot be protected with an anti-XSRF token (e.g. a login service), then especially always make sure that they don’t return valid JSON/JavaScript containing any valuable information!

    If you absolutely have to, then always wrap the response in JavaScript comments (/* */), as explained in http://code.google.com/webtoolkit/articles/security_for_gwt_applications.html#json . Or even better: Prepend the response with while(1);, as explained in Why have "while(1);" in XmlHttpRequest response?. This is a good practice anyway.

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

Sidebar

Related Questions

I have implemented pretty simple application, using gwt and gwt event service 1.1.1, it
In our desktop application, we have implemented a simple search engine using an inverted
Very simple Qt GUI application: On the scene I have multiple circles implemented as
I have implemented a simple close() method for all the Backbone views which disposes
I have implemented simple com.sun.net.httpserver.HttpServer application using one of examples in the internet. Server
I have implemented a simple jqGrid in my ASP.NET MVC 3 application. It shows
I have implemented a simple Android application that I now would like to test
This is a weired problem, I have implemented simple quick sort as follows.. static
I have implemented a simple file upload-download mechanism. When a user clicks a file
I have implemented a simple linux shell in c. Now, I am adding some

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.