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

dropwizard-healthcheck exposes too much information on public port #7072

Open
markjeffreymiller opened this issue May 2, 2023 · 2 comments
Labels

Comments

@markjeffreymiller
Copy link

Prior to Dropwizard 2.1, the healthcheck JSON output (from io.dropwizard.modules:dropwizard-health) was limited to pretty much a boolean output ("healthy" or "unhealthy").

With 2.1, the JSON response (when requested with /health-check?name=all) gives a fine-grained status for each upstream service, and it does so on the public port.

This seems slightly dangerous to me from both a security and privacy perspective. Take for instance a situation like the following, where we are leaking to the public that the service uses a specific database (security), AND that there's likely a major product announcement forthcoming (privacy):

 [
    {"name":"popular-database-with-known-vulnerabilities","healthy":true,"type":"READY","critical":true},
    {"name":"beta-chatgpt-hologram-nft-service","healthy":true,"type":"READY","critical":false}
]

Now, I'm not saying this is a rootkit-level sort of security threat, but my feeling has always been that Dropwizard should be skewing toward a "default secure" mindset. And of course a properly configured loadbalancer will prevent this access from occurring, but not everyone is perfect all of the time.

I'm all for exposing this detailed information on the admin port, and for exposing a very limited, zero-details healthcheck service on the public port. But it really seems like a security failure to make those details available, in the default configuration, on the public port.

@markjeffreymiller markjeffreymiller changed the title DW 2.1: new healthcheck on main port exposes too much information on public port DW 2.1: new healthcheck exposes too much information on public port May 2, 2023
@joschi joschi added the security label May 3, 2023
@joschi joschi changed the title DW 2.1: new healthcheck exposes too much information on public port dropwizard-healthcheck exposes too much information on public port May 3, 2023
@github-actions github-actions bot added the stale Stale issue or pull request which will be closed soon label Oct 31, 2023
@zUniQueX zUniQueX removed the stale Stale issue or pull request which will be closed soon label Oct 31, 2023
@dropwizard dropwizard deleted a comment from github-actions bot Nov 4, 2023
@ryankennedy
Copy link
Member

ryankennedy commented Apr 3, 2024

Unless I’m mistaken, healthchecks are only available on the admin port. So unless you’re using something like the simple server (which allows you to serve the admin endpoints on the “main” server port), this shouldn’t be a concern. Are you running with the simple server factory?

@markjeffreymiller
Copy link
Author

markjeffreymiller commented Apr 13, 2024

I run DW with a pretty heavily-customized set of dependencies so I wasn't 100% sure about myself, but I went ahead and created a new project using the mvn archetype command, and it's definitely exposing the healthcheck names on the primary port:

# curl 'http://localhost:8080/healthcheck' ## main port without "?name=all"
[]%                                                                                                                                                                                                                                                           ➜  helloplanet git:(main) 
# curl 'http://localhost:8080/healthcheck?name=all' ## main port with "?name=all"; response includes healthcheck names
[{"name":"looking-good-billyray","healthy":true,"type":"READY","critical":true}]%                                                                                                                                                                             ➜  helloplanet git:(main) 
# curl 'http://localhost:8081/healthcheck?name=all' ## admin port; response includes healthcheck names *and messages*
{"deadlocks":{"healthy":true,"duration":0,"timestamp":"2024-04-12T23:34:41.579-07:00"},"looking-good-billyray":{"healthy":true,"message":"Feeling Good, Lewis","duration":0,"timestamp":"2024-04-12T23:34:41.579-07:00"}}%                                    ➜  helloplanet git:(main) 

Sample project: https://github.com/markjeffreymiller/helloplanet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants