Giter VIP home page Giter VIP logo

Comments (7)

tsegismont avatar tsegismont commented on August 15, 2024

Hi @chrispatmore

This is the wrong repository, this issue should have been reported to vertx-web.

Anyway, it seems ok to me if you can't make non-GET requests until you get a new token, that's the purpose of the CSRF token.
If you make a GET request though, it should be sent as a response header, even after a POST request which was never replied.

Perhaps what you want is that the cookie is updated if does not contain the refreshed token?

Would that be fine regarding security @pmlopes ?

from vertx-auth.

chrispatmore avatar chrispatmore commented on August 15, 2024

Oops sorry, do you want me to move it?

Yea GET requests updating the token would be fine, as it would enable the user to carry on without logging in again

from vertx-auth.

tsegismont avatar tsegismont commented on August 15, 2024

Oops sorry, do you want me to move it?

Yes please

from vertx-auth.

pmlopes avatar pmlopes commented on August 15, 2024

CSRF is a mitigation against replay attacks, hence the issue that a request that never finishes, blocks the whole sequence of future requests. The way I see it is that:

https://github.com/vert-x3/vertx-web/blob/d64ec59431aa8d613aa4fbd869466f59b841c1a9/vertx-web/src/main/java/io/vertx/ext/web/handler/impl/CSRFHandlerImpl.java#L130-L132C7

and:

https://github.com/vert-x3/vertx-web/blob/d64ec59431aa8d613aa4fbd869466f59b841c1a9/vertx-web/src/main/java/io/vertx/ext/web/handler/impl/CSRFHandlerImpl.java#L250

Should only happen on a successful response:

https://github.com/vert-x3/vertx-web/blob/d64ec59431aa8d613aa4fbd869466f59b841c1a9/vertx-web/src/main/java/io/vertx/ext/web/RoutingContext.java#L314

By wrapping that code only in case of success. This should address the cases:

  1. a never-ending response, will not rotate the token, (this example) so the next call will succeed
  2. a call that fails for some reason (say internal server error) will preserve the state

Tests need to be run to verify if this works as expected.

from vertx-auth.

tsegismont avatar tsegismont commented on August 15, 2024

Thanks @pmlopes !

So @chrispatmore , if you can provide a test for Vert.x Web that shows 1/ and /2 don't work, please open an issue there.

from vertx-auth.

chrispatmore avatar chrispatmore commented on August 15, 2024

Sorry to be clear, you would like me to:

move this issue to web, then work on this issue using suggestion from @pmlopes ?

from vertx-auth.

tsegismont avatar tsegismont commented on August 15, 2024

Sorry to be clear, you would like me to:

move this issue to web, then work on this issue using suggestion from @pmlopes ?

yes please

from vertx-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.