Token mismatch error, TamperMonkey, and userscripts

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Token mismatch error, TamperMonkey, and userscripts

Postby cssyphus » 12. August 2021 15:42

Why do userscripts (i.e. Tampermonkey) not work in phpMyAdmin? In fact, even adding an empty userscript onto the phpMyAdmin page will result in a "token mismatch" error. See this StackOverflow post:
https://stackoverflow.com/questions/17602093/xampp-error-token-mismatch/60531054#60531054

Does anyone have any knowledgeable experience with this known problem?

Is there a bandaid fix (without installing a new version of XAMPP)?

I am using XAMPP 7.3.8 (phpMyAdmin 4.9.0.1).
Thanks.
cssyphus
 
Posts: 2
Joined: 12. August 2021 15:22
XAMPP version: 7.3.8
Operating System: Win7sp1

Re: Token mismatch error, TamperMonkey, and userscripts

Postby Altrea » 12. August 2021 20:03

Hi,

good secure webapplications are securing user data by checking a CSRF Token.
Means you cannot send any user data from foreign scripts, except you know and transfer the correct token id which changes for each form access.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11926
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Token mismatch error, TamperMonkey, and userscripts

Postby cssyphus » 12. August 2021 21:20

Clarification: The userscript in question does not update tables or make any changes to the database. It only injects some css onto the page to hide an unwanted div. This causes a Token Mismatch error upon initial page load.

I tested this by removing the userscript contents - that is, the userscript does absolutely nothing. But just having it match the page URL caused the Token Mismatch error.

Why would this happen when the database itself is not impacted in any way?

Note that I am not complaining or unhappy with XAMPP in any way, I just want to understand.

In fact, I now remember what I wanted to do with that userscript -- I wished to change the title attribute in the page [head][/head], so that the browser tab would be something meaningful (i.e. the project name) since I had multiple phpMyAdmin instances open and wanted to know which tab was which. As it is, both say "localhost:8..." (and that's all the room there is on the tabs)
cssyphus
 
Posts: 2
Joined: 12. August 2021 15:22
XAMPP version: 7.3.8
Operating System: Win7sp1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 119 guests