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
Add prioritize option for header check order #75
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So
X-Forwarded-For
header can be exploited with this library if we add XFF header in the request.On Nginx, we can use the alternative
X-Real-IP
header for$remote_addr
value.Maybe we can add something like below?
app.use( clientIp.mw({ prioritize: ["x-real-ip",], }) );
This will push change header priority list from
default
[ 'x-client-ip', 'x-forwarded-for', 'cf-connecting-ip', 'fastly-client-ip', 'true-client-ip', 'x-real-ip', 'x-cluster-client-ip', 'x-forwarded', 'forwarded-for', 'forwarded', 'x-appengine-user-ip', ];
to
[ 'x-real-ip', 'x-client-ip', 'x-forwarded-for', 'cf-connecting-ip', 'fastly-client-ip', 'true-client-ip', 'x-cluster-client-ip', 'x-forwarded', 'forwarded-for', 'forwarded', 'x-appengine-user-ip', ];
The text was updated successfully, but these errors were encountered: