Welcome to our new JIRA instance! We migrated all OpenMRS ID accounts and issues to this new cloud instance. Please use your_openmrsid@id.openmrs.org as your e-mail to sign in.

Fix the Invalid or Missing CSRF Token in the Legacy UI

Description

This shows up all the time, mostly in valid settings.

Activity

Show:

Wikum Weerakutti November 25, 2024 at 7:46 AM

I am closing this for the platform 2.7.0 release.

Daniel Kayiwa November 1, 2024 at 3:17 PM
Edited

CSRF Guard appends a hidden input field with the CSRF token at the end of the form. For this particular form, the form data was too much that tomcat just ignored the extra parameters including the one that CSRF Guard had appended. This explains why you would not reproduce this error when the number of global properties was small. That is how i fixed it on dev3 by simply resetting it and hence reducing the number of global properties to the initial default. I was able to reproduce it locally by simply increasing my number of global properties to something like 450.

So the fix is to make CSRF Guard insert the CSRF token hidden input field as the first child such that it does not get ignored by the server when the parameters are too many. The other alternative would be to configure tomcat parameters like maxParameterCount to increase the size.

Daniel Kayiwa November 1, 2024 at 3:10 PM

Daniel Kayiwa November 1, 2024 at 3:05 PM

Fixed

Details

Assignee

Reporter

Fix versions

Affects versions

Priority

Created October 30, 2024 at 6:44 PM
Updated November 25, 2024 at 7:46 AM
Resolved November 25, 2024 at 7:46 AM

Flag notifications