Skip to content
This repository was archived by the owner on Dec 15, 2018. It is now read-only.
This repository was archived by the owner on Dec 15, 2018. It is now read-only.

CSRF token is only validated if there are @FormParams #79

@mvcbot

Description

@mvcbot

Original issue OZARK-63 created by Christian Kaltepoth:

The CSRF page token validation works fine in this case:

@Controller
@Path("/foobar")
public class TweetController {

  @POST
  @CsrfValid
  public String post( @FormParam("text") String text ) {
    System.out.println("CSRF page token valid!");
    return ....;
  }

}
{code}

But if I remove the controller method parameter, the check seems to get skipped and the controller method is always executed. Even if the page token is missing.

{code:java}
@Controller
@Path("/foobar")
public class TweetController {

  @POST
  @CsrfValid
  public String post( /** empty **/ ) {
    System.out.println("CSRF page token valid!");
    return ....;
  }

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions