Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get IP from "standard" HTTP headers #3287

Open
matrixbot opened this issue Nov 1, 2024 · 4 comments
Open

Get IP from "standard" HTTP headers #3287

matrixbot opened this issue Nov 1, 2024 · 4 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.

Comments

@matrixbot
Copy link
Collaborator

This issue was originally created by @S7evinK at matrix-org/dendrite#3287.

...

But, if I may, do you think Dendrite should perhaps auto-try any of the standard "this is the client's real IP" headers automatically? Do you see any downsides in doing that? For what it's worth, from my limited self-hosting experience, many applications do it automatically, given the current trends in hosting stuff (everything behind reverse proxy or ingress or whatever)

Best regards
Zbig

Originally posted by @zbig-t in matrix-org/dendrite#3286 (comment)

@matrixbot matrixbot added good first issue Good for newcomers help wanted Extra attention is needed T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Nov 1, 2024
@matrixbot
Copy link
Collaborator Author

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @zbig-t at matrix-org/dendrite#3287 (comment).

Thanks, I think (hope) that's not beyond my abilities. Will create a PR once I mange to take care of that.

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @Curious-r at matrix-org/dendrite#3287 (comment).

I think it's necessary.
Now I'm use X-Forwarded-For instead of X-Real-ip, because the former exists in a lot of reverse proxies as a standard header。

@matrixbot
Copy link
Collaborator Author

This comment was originally posted by @bones-was-here at matrix-org/dendrite#3287 (comment).

None of these headers are safe to trust in the default configuration, unless Dendrite will never use the information for anything important.

To be trustworthy the IP header must be set by a trusted reverse proxy that also discards any (potentially spoofed) information it receives in these headers. The various proxy implementations have different default behaviours, might not be using their defaults, or the admin might not be using a proxy at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements.
Projects
None yet
Development

No branches or pull requests

1 participant