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

[🔺] IP getter is *still* broken #101

Closed
Sv443 opened this issue Jun 9, 2020 · 2 comments · Fixed by #103
Closed

[🔺] IP getter is *still* broken #101

Sv443 opened this issue Jun 9, 2020 · 2 comments · Fixed by #103
Assignees
Labels
bug Something isn't working
Milestone

Comments

@Sv443
Copy link
Member

Sv443 commented Jun 9, 2020

IPs are still not being resolved sometimes which leads to the wrong people being rate limited.

Explanation:
The API tries to resolve the client's IP but if it can't find it or it is invalid, the API assigns a null constant as the client's IP address. If some other client, who also has a null IP address now sends 60 requests in a minute, all other clients with invalid / unresolvable IP addresses also get rate limited, since the API thinks their IP addresses are the exact same.

Also on a side note: I'm talking about hashed IP addresses. Your actual IP address is not known to me at any point nor is it visible in any logs.

@Sv443 Sv443 added the bug Something isn't working label Jun 9, 2020
@Sv443 Sv443 self-assigned this Jun 9, 2020
@Sv443 Sv443 added this to the 2.2.0 milestone Jun 9, 2020
@Sv443 Sv443 linked a pull request Jun 9, 2020 that will close this issue
27 tasks
@Sv443 Sv443 mentioned this issue Jun 9, 2020
27 tasks
@Sv443 Sv443 changed the title IP getter is *still* broken [HIGH PRIO] IP getter is *still* broken Jun 10, 2020
@Sv443 Sv443 modified the milestones: 2.2.0, 2.1.4 Jun 10, 2020
@Sv443
Copy link
Member Author

Sv443 commented Jun 10, 2020

Changed milestone to hotfix version 2.1.4 since this has such a high priority.

@Sv443 Sv443 changed the title [HIGH PRIO] IP getter is *still* broken [🔺] IP getter is *still* broken Jun 10, 2020
@Sv443 Sv443 removed a link to a pull request Jun 10, 2020
27 tasks
@Sv443
Copy link
Member Author

Sv443 commented Jun 10, 2020

I found out what the issue is.
It's that the resolveIP module can only resolve IPv4 addresses and can't parse IPv6.
Additionally, some headers are incorrect (use _ instead of -) and some headers don't even exist anymore.
Very very quick fix would be to use the Cloudflare header cf-pseudo-ipv4 to get an IPv4 representation of the IPv6 address and to replace the _ with -.

@Sv443 Sv443 linked a pull request Jun 12, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant