Why is the CSRF framework have a minimum value of 10 minutes? | Community
Skip to main content
New Participant
Oct 23, 2018 12:35 PM UTC
Solved

Why is the CSRF framework have a minimum value of 10 minutes?

The OOTB CSRF Framework has a minimum value of 10 minutes configured by default and cannot be reduced to below this value. What is the logic behind this limitation? Would it be possible for an attacker to use the csrf token to perform an attack.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Anselm_H_Accepted solution
Level 2
Feb 28, 2019 4:19 PM UTC

I just have an educated guess... See /etc.clientlibs/clientlibs/granite/jquery/granite.js:// refreshing csrf token periodically

setInterval(function() {

    getToken();

}, 300000);

This means that every 5 minutes the CSRF-Token gets refreshed in the Browser. So if you set the time below 10 minutes in the CSRFServlet there would be a risk that a valid Browser-Token is not valid anymore at backend. Values above 10 min are fine, because they will be refreshed every 5 min in the Browser.

4 replies

Anselm_H_Accepted solution
Level 2
Feb 28, 2019 4:19 PM UTC

I just have an educated guess... See /etc.clientlibs/clientlibs/granite/jquery/granite.js:// refreshing csrf token periodically

setInterval(function() {

    getToken();

}, 300000);

This means that every 5 minutes the CSRF-Token gets refreshed in the Browser. So if you set the time below 10 minutes in the CSRFServlet there would be a risk that a valid Browser-Token is not valid anymore at backend. Values above 10 min are fine, because they will be refreshed every 5 min in the Browser.

Translate
smacdonald2008
Level 10
Oct 23, 2018 3:02 PM UTC

We have asked the team if anyone can provide more infor on the 10 min default value.

Translate
New Participant
Oct 23, 2018 2:17 PM UTC

Yes, But WHY is it restricted to a minimum of 10 minutes?

Translate
arunpatidar
New Participant
Oct 23, 2018 2:02 PM UTC
Arun Patidar