-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Information leak in OAuth2 plugin #1617
Comments
@Dibble what message would you suggest returning? |
@thefosk I think the easiest change would be to simply remove Kong from the response. However given that this endpoint is only designed to be accessed by a third-party backend, rather than any clients, I think it might make more sense to return a 401 or a 403 if the Even better might be enabling IP whitelisting for that endpoint, returning 404s for blocked requests. |
@Dibble the PR above ^ removes "Kong" from the error message. |
Wouldn't a simple googling of the error message lead to this repository anyways? Also, isn't the |
As you say, anyone could Google the msg and end up here, this is largely aimed at not showing up in opportunistic/automatic scans. This change isn't going to be much help in a focused/manual probe but it has some merit. We have also stripped the 'kong/x.x.x' headers too and would suggest it as a configurable option as a feature. We have both internal and professional penetration tests carried out periodically which would fail us with an explicit technology name like this leaking out. My main preference for this specific endpoint is to send back a fairly unhelpful 401 given it should never be invoked legitimately by anything other than the owner of the gateways identiy provider; however, that would be more invasive API change. |
That's fine with me. I just merged #1633 and we'll include it in the upcoming |
(BTW, configuring the |
Summary
Information about the underlying technology (Kong) is leaked when a bad request is made to the OAuth2 plugin.
Incorrect POST requests to the
/oauth2/authorize
endpoint return this error message:Steps To Reproduce
curl -i -X POST https://<kong>/<api>/oauth2/authorize
Additional Details & Logs
$ kong version
): 0.8.3 (and 0.9.1)$ kong start --vv
): N/A<KONG_PREFIX>/logs/error.log
): N/AThe text was updated successfully, but these errors were encountered: