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

X-Forwarded-For does an insecure internal DNS lookups for user-provided hosts #752

Open
tenor-dev opened this issue Sep 26, 2022 · 0 comments

Comments

@tenor-dev
Copy link

An attacker can put a DNS name into the X-Forwarded-For header and Ninja would do a DNS lookup of it.

The code responsible is in AbstractContext.getRemoteAddr:

                    // If ip4/6 address string handed over, simply does pattern validation.
                    InetAddress.getByName(forwardHeader);

So, contrary to the comment, getByName doesn't do a simple validation, but also does a DNS lookup if the provided value is not an IP address. This code is irrelevant and should be removed.

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

No branches or pull requests

1 participant