Page 1 of 1

AJAX_ERROR on Dashboard

Posted: Thu 2. Jun 2022, 10:51
by ChiefZA
---------------------------------------------------------------------------


I'm sure the cause of the problem is within KeyHelp
(Problems not related to KeyHelp belong in the Offtopic forum)


Ubuntu 20.04
(e.g. Ubuntu 20.04)


KVM
(e.g. none, OpenVZ, KVM, XEN, etc.)


22.0 (Build 2393)



I am receiving an AJAX_ERROR in Service/port monitoring and update information with the error: Failed to retrieve update information.
It is also throwing an AJAX_ERROR for the news tab on the dashboard. Console gives these errors:
AJAX-ERROR
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:132 Type: parsererror
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:133 Staus: 200 - parsererror
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:134 Response:
Invalid session.
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:131 AJAX-ERROR
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:132 Type: parsererror
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:133 Staus: 200 - parsererror
functions.js?v=385251d48450fc342bf98fc99412f3991ca8e6fc:134 Response:
Invalid session.


Expected result


Actual result


Steps to reproduce


It's happening after a fresh install so there wasn't any changes made.
(e.g. recent changes to the server, excerpts from log files (/var/log/*, /var/log/keyhelp/php-error.log, etc.))

Re: AJAX_ERROR on Dashboard

Posted: Thu 2. Jun 2022, 11:48
by l_fish
I can confirm this error (KeyHelp 22.0 (Build 2393) on Debian 11.3 (64-bit)).

Re: AJAX_ERROR on Dashboard

Posted: Thu 2. Jun 2022, 16:04
by ChiefZA
Image
Image
Image

Re: AJAX_ERROR on Dashboard

Posted: Thu 2. Jun 2022, 16:58
by technotravel
Not for me:

Debian11 with all latest updates
Keyhelp 22.0 (Build 2393)

So it seems it doesn't affect everybody ...

Re: AJAX_ERROR on Dashboard

Posted: Thu 2. Jun 2022, 17:16
by Florian
Hello,

this is no general issue. It also works on my Debian 11 test servers.

Something on your server must block the requests

Re: AJAX_ERROR on Dashboard

Posted: Fri 3. Jun 2022, 08:44
by l_fish
For me it seems to be a browser problem. I get the ajax error only with Brave browser. The ajax call returns a "Invalid session." instead of the correct data in that case.

In Chrome and Firefox the ajax calls are successful. Since Brave is more strict about privacy protection it may handle cookie + ajax a bit different than the other browsers.

Re: AJAX_ERROR on Dashboard

Posted: Fri 3. Jun 2022, 09:51
by Alexander
I checked it with Brave Browser and can reproduce the problem. Other Browsers work fine.

Background information: KeyHelp has an anti-session-hijack-mechanism, which ensures that a session cannot be hijacked by an attacker by checking (among other checks) various browser features to see if they are still the same as the last time they the browser performed a request.

The problem now is that Brave seems to be inconsistent when accessing a page directly and when performing an Ajax request. (Specifically: it sends different HTTP_ACCEPT_LANGUAGE headers), which is strange behavior. I will now have to check why they are doing this and how to prevent it....

Re: AJAX_ERROR on Dashboard  [SOLVED]

Posted: Fri 3. Jun 2022, 10:19
by Alexander
I fixed it via the Brave settings:

1) Go to Settings
2) Turn off the fingerprint settings ("Prevent websites from fingerprinting me based on my language settings")

---

I see what they are trying to achieve, but as this is a security feature of KeyHelp (and of course is not for tracking within KeyHelp) I am not planing in changing anything in the behavior of KeyHelp for now.

Re: AJAX_ERROR on Dashboard

Posted: Fri 3. Jun 2022, 13:01
by l_fish
Alexander wrote: Fri 3. Jun 2022, 10:19 I fixed it via the Brave settings:

1) Go to Settings
2) Turn off the fingerprint settings ("Prevent websites from fingerprinting me based on my language settings")
Confirmed here. Thank you, Alex! :)

Re: AJAX_ERROR on Dashboard

Posted: Sat 11. Jun 2022, 17:54
by ChiefZA
I was using Brave browser, and when I tried it on Chrome, the problem disappeared. Wow, good catch.