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

Update: Use better method to get IP address #9

Closed
alx-tuilmenau opened this issue Sep 26, 2024 · 0 comments · Fixed by #15
Closed

Update: Use better method to get IP address #9

alx-tuilmenau opened this issue Sep 26, 2024 · 0 comments · Fixed by #15
Assignees

Comments

@alx-tuilmenau
Copy link

Hello,

I downloaded your software yesterday but i'm still struggling get it running (it will not activate on any account, i only added the PI URL and the "active" checkmark in settings for use with OTP only).

But while debugging I found something security related. In the getClientIp function in the Provider class you check HTTP_X_FORWARDED_FOR for the IP with the highest priority. So everyone which can set this header can spoof any IP. There is a global setting in nextcloud, 'trusted_proxies', which you should check additionally and use this header only, if the reals IP is in this configuration array. Simple solution should be to use getRemoteAddress() from the Request-Class you are already using, which will check this.

Alex

@lukasmatusiewicz lukasmatusiewicz self-assigned this Oct 2, 2024
@lukasmatusiewicz lukasmatusiewicz changed the title Maybe security bug: Getting IP Address Update: Use better method to get IP address Oct 2, 2024
@lukasmatusiewicz lukasmatusiewicz linked a pull request Oct 8, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants