You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description CSRF prevention can be difficult to do correctly for the regular Quarkus applications. Some extensions such as quarkus-oidc do some work around it, with some users might be trying CORS to minimize the risks (which is deemed insufficient, search for CSRF CORS).
Pedro @pedroigor pointed out that it would be good if Quarkus could offer a built-in feature to help with the CSRF prevention
Implementation ideas
Perhaps we can use some existing library or do our own solution, and provide quarkus-http-csrf-prevention. Or quarkus-http-attack-prevention which will grow starting from the CSRF prevention and then cover more at the later stage. Or perhaps reuse some existing Undertow and Vertx features
@kekbur I've started prototyping a RestEasy Reactive filter based on your code (thanks for sharing it).
I can see how it can be made quite generic and configurable. The problem I'm thinking about is one has to buffer the stream if no marking is supported and I doubt it will be supported.
I wonder would be simpler to have
@Path("service")
public class Service {
@POST
void post(@FormParam("csrf-token-field") String csrfTokenField, @CookieParam("csrf") Cookie csrfCookie) {
}
}
and just compare it. I guess it can be made configurable and let the filter skip the actual comparison
Description
CSRF prevention can be difficult to do correctly for the regular Quarkus applications. Some extensions such as
quarkus-oidc
do some work around it, with some users might be trying CORS to minimize the risks (which is deemed insufficient, search forCSRF CORS
).Pedro @pedroigor pointed out that it would be good if Quarkus could offer a built-in feature to help with the CSRF prevention
Implementation ideas
Perhaps we can use some existing library or do our own solution, and provide
quarkus-http-csrf-prevention
. Orquarkus-http-attack-prevention
which will grow starting from the CSRF prevention and then cover more at the later stage. Or perhaps reuse some existing Undertow and Vertx featuresCC @pedroigor @stianst @stuartwdouglas @darranl
The text was updated successfully, but these errors were encountered: