mirror of
https://github.com/retspen/webvirtcloud
synced 2026-11-11 12:46:49 +00:00
fix: require POST for user block/unblock and OTP email, flag console cookie
- user_block, user_unblock and admin_email_otp changed state on GET, so an <img> tag could lock a user out or trigger OTP emails through an admin's session. They now require POST; the buttons are CSRF forms. - The console token cookie is set with httponly, SameSite=Lax and, on HTTPS, secure. Only novncd reads it; the page gets the token directly.
This commit is contained in:
parent
e76149c71a
commit
cf1cde376b
8 changed files with 77 additions and 6 deletions
|
|
@ -166,5 +166,8 @@ def console(request):
|
|||
}
|
||||
response = render(request, "console-vnc-lite.html", locals())
|
||||
|
||||
response.set_cookie("token", token)
|
||||
# Only novncd reads this cookie; JavaScript gets the token from the page.
|
||||
response.set_cookie(
|
||||
"token", token, httponly=True, samesite="Lax", secure=request.is_secure()
|
||||
)
|
||||
return response
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue