mirror of
https://github.com/retspen/webvirtcloud.git
synced 2026-04-26 07:55:52 +03:00
[GH-ISSUE #630] CSRF 403 error when trying to enable guest agent. #363
Labels
No labels
bug
enhancement
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/webvirtcloud#363
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @oreillymj on GitHub (Jan 15, 2024).
Original GitHub issue: https://github.com/retspen/webvirtcloud/issues/630
Since upgrading to the latest version of Webvirt cloud and associated django version, I see CSRF 403 errors when using the UI.
Specifically trying to enable the guest agent.
Looking at Chrome dev tools, I see a mis-match between the forms csrf token and the value in the csrf cookie.
I'm completely unable to login in a private window due to a 403.
When looking at dev tools, I see cookie set to
csrftoken=zhMVW2QdpvjMWGcW8umYb32sUYvlEu5z; token=3-5570c1d9-8da8-437e-84e4-fb5ce744b36e
but the csrftoken on the embedded form is ....
csrfmiddlewaretoken: 878NbOOzWhERjIK09BJGlZinBQ7zrxXyxeKyXGuCbCNt5eMM7VVumSaFlEsKVRSX
Not sure if that mismatch causes the 403
@catborise commented on GitHub (Jan 17, 2024):
Could you be trying to reactivate a previously activated device? "Disconnected" typically means that guest tools are not installed on the operating system or the guest service is not running.
@oreillymj commented on GitHub (Jan 18, 2024):
All was working before upgrading to latest github commit. supervisorctl shows 3 running services.
I should mention that I have upgrade from Ubuntu20.04LTS ->22.04LTS, got Webvirtcloud running and I'm now on the 24.04 beta. I had to re-run pip3 so I maybe on a newer Django release which has stricter CSRF protection.
https://docs.djangoproject.com/en/5.0/howto/csrf/
@whsir commented on GitHub (Apr 2, 2024):
I'm having the same problem.
CSRF 403
@jbguo424 commented on GitHub (May 7, 2024):
Modify the settings.py like below
CSRF_TRUSTED_ORIGINS = ['http://localhost','http://your ip']