mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-12-10 17:23:04 +03:00
ignoring X-Forwarded-For headers? #2254
Reference in New Issue
Block a user
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 @tycho on GitHub.
I notice that when using a reverse proxy, bitwarden_rs logs the wrong IP address:
[2018-12-17][09:47:45][bitwarden_rs::api::identity][ERROR] Username or password is incorrect. Try again. IP: 127.0.0.1. Username: ...This is especially sloppy looking since that error message gets surfaced to the user on the web vault.
My reverse proxy is setting the
X-Forwarded-Forheader, but it seems that bitwarden_rs doesn't pay attention to that when determining the client IP?@tycho commented on GitHub:
Seems reasonable to me!
@tycho commented on GitHub:
Oh, maybe the
PROXY.mdshould make mention of theX-Real-IPthing. Here's what I did for nginx:@tycho commented on GitHub:
Yep, I switched to
X-Real-IPand that works! Thanks!@dani-garcia commented on GitHub:
Rocket uses
X-Real-IPfor retrieving the clients IP address, instead ofX-Forwarded-For.The error message comes from a time where we didn't have any decent logging in place, but it could be changed now to hide that info from the user.
@dani-garcia commented on GitHub:
True, I use Caddy which does this by default, so I didn't know. What do you think of adding these (to be equivalent with what Caddy sends)?