Change in the JavaScriptServlet doPost() logic in 4.1.1 from 3.1.0 #52
-
Currently switching to use 4.1.1 from 3.1.0 version of the library. The doPost method in the JavaScriptServlet.java class in 3.1.0 first checked if the Our code sets the property to org.owasp.csrfguard.TokenPerPage = false. I am trying to understand why this change was made and how we can remediate the issue on our side. @forgedhallpass Could you please help me understand the reason for the change and what would be the best path forward? Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hello, Adding this feature in 4.1.1 is not an issue in the CSRFGuard. It is an security enhancement to avoid to bypass CSRFGuard using other attacks like XSS for example. |
Beta Was this translation helpful? Give feedback.
-
Hello @crkharan, In Currently, the general execution flow in short (non-JSP), is the following:
The documentation of the possible configuration properties can be found in the There is also a |
Beta Was this translation helpful? Give feedback.
Hello @crkharan,
In
4.x
the code base went through a major refactoring, both on Java and JavaScript side, hence if you're upgrading, you'll have to use the latest version ofcsrfguard.js
.Currently, the general execution flow in short (non-JSP), is the following:
script
tag in HTML references theJavaScriptServlet
. In most cases this needs to be the first resource to be referenced.GET
request againstJavaScriptServlet
returns the JS code with an embeddedmasterToken
.token-per-page
functionality is enabled a (second)POST
request against the servlet is made with themasterToken
.masterToken
is correct, andtoken-precreate
is enabled, the response will contain the l…