Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FormTagLib.form passes wrong method to RequestDataValueProcessor #28

Open
askask opened this issue Jun 8, 2018 · 0 comments
Open

FormTagLib.form passes wrong method to RequestDataValueProcessor #28

askask opened this issue Jun 8, 2018 · 0 comments

Comments

@askask
Copy link

askask commented Jun 8, 2018

Steps to Reproduce

  1. Create a Grails web application and add Spring Security Web as a dependency
  2. Configure CSRF protection in resources.groovy:
requestDataValueProcessor(org.springframework.security.web.servlet.support.csrf.CsrfRequestDataValueProcessor)
csrfFilter(org.springframework.security.web.csrf.CsrfFilter, new org.springframework.security.web.csrf.HttpSessionCsrfTokenRepository())
  1. Create a GSP file containing a g:form element

Expected Behaviour

I expect that the CSRF token is added to the form.

Actual Behaviour

It isn't added.

Environment Information

  • Operating System: Linux
  • Grails Version: 2.5.1 (the relevant code did not change since then however)
  • JDK Version: 8
  • Container Version (If Applicable): 2.5

-

I think the problem is

link= requestDataValueProcessor.processAction(request, link, request.method)

Here the method of the form should be passed, not the method used to request the page containing the form.
See also the documentaton for the RequestDataValueProcessor interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant