Unable to Deauthorize sessions #1756

Closed
opened 2026-02-05 01:40:09 +03:00 by OVERLORD · 9 comments
Owner

Originally created by @MButcho on GitHub (Nov 6, 2023).

Subject of the issue

When I try to Deauthorize sessions, I receive following error:
image

The reason is I wanted to implement push notifications, which are not working

Deployment environment

  • vaultwarden version :v1.30.0

  • Install method: Docker image

  • Clients used: web vault, desktop, iOS

  • Reverse proxy and version: nginx version: nginx/1.18.0 (Ubuntu)

  • Nginx config:

http {
    upstream vaultwarden-default {
    zone vaultwarden-default 64k;
    server 127.0.0.1:8088;
    keepalive 2;
  }
  
  upstream vaultwarden-ws {
    zone vaultwarden-ws 64k;
    server 127.0.0.1:3012;
    keepalive 2;
  }

  server {
    server_name some.domain.com;
    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;
    
    client_max_body_size 128M;

    location / {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "Upgrade";

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://vaultwarden-default;
    }

    location /notifications/hub/negotiate {
      proxy_http_version 1.1;
      proxy_set_header "Connection" "";

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://vaultwarden-default;
    }

    location /notifications/hub {
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection "upgrade";

      proxy_set_header Host $host;
      proxy_set_header X-Real-IP $remote_addr;
      proxy_set_header Forwarded $remote_addr;
      proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
      proxy_set_header X-Forwarded-Proto $scheme;

      proxy_pass http://vaultwarden-ws;
    }

    # Optionally add extra authentication besides the ADMIN_TOKEN
    # Remove the comments below `#` and create the htpasswd_file to have it active
    #
    #location /admin {
    #  # See: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/
    #  auth_basic "Private";
    #  auth_basic_user_file /path/to/htpasswd_file;
    #
    #  proxy_http_version 1.1;
    #  proxy_set_header "Connection" "";
    #
    #  proxy_set_header Host $host;
    #  proxy_set_header X-Real-IP $remote_addr;
    #  proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    #  proxy_set_header X-Forwarded-Proto $scheme;
    #
    #  proxy_pass http://vaultwarden-default;
    #}
    
    listen 443 ssl; # managed by Certbot
    ...
  }

Steps to reproduce

Log into web account / Account Settings / My Account / Deauthorize sessions / Send Code

Expected behaviour

Send email to confirm sessions deauthorize

Actual behaviour

Error above

Troubleshooting data

Log:
[2023-11-06 20:21:16.316][request][INFO] POST /api/accounts/request-otp
[2023-11-06 20:21:16.316][response][INFO] 404 Not Found

Originally created by @MButcho on GitHub (Nov 6, 2023). ### Subject of the issue When I try to Deauthorize sessions, I receive following error: ![image](https://github.com/dani-garcia/vaultwarden/assets/41790777/130be9b0-4b92-40b5-8af5-80fa7a77fbab) The reason is I wanted to implement push notifications, which are not working ### Deployment environment * vaultwarden version :v1.30.0 * Install method: Docker image * Clients used: web vault, desktop, iOS * Reverse proxy and version: nginx version: nginx/1.18.0 (Ubuntu) * Nginx config: ``` http { upstream vaultwarden-default { zone vaultwarden-default 64k; server 127.0.0.1:8088; keepalive 2; } upstream vaultwarden-ws { zone vaultwarden-ws 64k; server 127.0.0.1:3012; keepalive 2; } server { server_name some.domain.com; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; client_max_body_size 128M; location / { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "Upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://vaultwarden-default; } location /notifications/hub/negotiate { proxy_http_version 1.1; proxy_set_header "Connection" ""; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://vaultwarden-default; } location /notifications/hub { proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection "upgrade"; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header Forwarded $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_pass http://vaultwarden-ws; } # Optionally add extra authentication besides the ADMIN_TOKEN # Remove the comments below `#` and create the htpasswd_file to have it active # #location /admin { # # See: https://docs.nginx.com/nginx/admin-guide/security-controls/configuring-http-basic-authentication/ # auth_basic "Private"; # auth_basic_user_file /path/to/htpasswd_file; # # proxy_http_version 1.1; # proxy_set_header "Connection" ""; # # proxy_set_header Host $host; # proxy_set_header X-Real-IP $remote_addr; # proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; # proxy_set_header X-Forwarded-Proto $scheme; # # proxy_pass http://vaultwarden-default; #} listen 443 ssl; # managed by Certbot ... } ``` ### Steps to reproduce Log into web account / Account Settings / My Account / Deauthorize sessions / Send Code ### Expected behaviour Send email to confirm sessions deauthorize ### Actual behaviour Error above ### Troubleshooting data Log: [2023-11-06 20:21:16.316][request][INFO] POST /api/accounts/request-otp [2023-11-06 20:21:16.316][response][INFO] 404 Not Found
OVERLORD added the enhancementbug labels 2026-02-05 01:40:09 +03:00
Author
Owner

@MButcho commented on GitHub (Nov 6, 2023):

Other actions that require OTP have the same issue, like exporting vault

@MButcho commented on GitHub (Nov 6, 2023): Other actions that require OTP have the same issue, like exporting vault
Author
Owner

@BlackDex commented on GitHub (Nov 7, 2023):

Seems this only gets triggered when using Login With Device i think when looking at the Bitwarden client code.

Can you confirm this?

@BlackDex commented on GitHub (Nov 7, 2023): Seems this only gets triggered when using `Login With Device` i think when looking at the Bitwarden client code. Can you confirm this?
Author
Owner

@MButcho commented on GitHub (Nov 7, 2023):

Correct, when using master password to log in, the export and deauthorize is possible

@MButcho commented on GitHub (Nov 7, 2023): Correct, when using master password to log in, the export and deauthorize is possible
Author
Owner

@BlackDex commented on GitHub (Nov 7, 2023):

Great thanks!

@BlackDex commented on GitHub (Nov 7, 2023): Great thanks!
Author
Owner

@BlackDex commented on GitHub (Nov 7, 2023):

Also, i would suggest to update your nginx config to not use port 3012 anymore, and remove those locations. Also, sending Connect: Upgrade all the time is probably not good.

Check the https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples for more details.

@BlackDex commented on GitHub (Nov 7, 2023): Also, i would suggest to update your nginx config to not use port 3012 anymore, and remove those locations. Also, sending `Connect: Upgrade` all the time is probably not good. Check the https://github.com/dani-garcia/vaultwarden/wiki/Proxy-examples for more details.
Author
Owner

@BlackDex commented on GitHub (Nov 7, 2023):

I'm able to reproduce this, so now to find the correct solution to fix this.

@BlackDex commented on GitHub (Nov 7, 2023): I'm able to reproduce this, so now to find the correct solution to fix this.
Author
Owner

@BlackDex commented on GitHub (Nov 7, 2023):

Ok, it looks like this needs SMTP to be enabled.
Without this, you can't export, deauthorize, and maybe more specific items, like purge vault etc..

With this feature a mail will be sent with a passcode which enables you to verify you are you when you used Login with device which was unlocked via either PIN or Biometrics.

@BlackDex commented on GitHub (Nov 7, 2023): Ok, it looks like this needs SMTP to be enabled. Without this, you can't export, deauthorize, and maybe more specific items, like purge vault etc.. With this feature a mail will be sent with a passcode which enables you to verify you are you when you used `Login with device` which was unlocked via either PIN or Biometrics.
Author
Owner

@kqmaverick commented on GitHub (Nov 8, 2023):

I have SMTP enabled and still see this error.

@kqmaverick commented on GitHub (Nov 8, 2023): I have SMTP enabled and still see this error.
Author
Owner

@BlackDex commented on GitHub (Nov 8, 2023):

I have SMTP enabled and still see this error.

That is correct, since the endpoints which are called are not supported by Vaultwarden.

But there could be people who do not have SMTP enabled for which this could be an issue.

Only way they can bypass is to login without an other device.

@BlackDex commented on GitHub (Nov 8, 2023): > I have SMTP enabled and still see this error. That is correct, since the endpoints which are called are not supported by Vaultwarden. But there could be people who do not have SMTP enabled for which this could be an issue. Only way they can bypass is to login without an other device.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/vaultwarden#1756