ShinyProxy Proxy API - How to hide *sensitive* information


I am currently fooling around with the Proxy API and noticed that, when accessed through POST, all the app information is returned, including some very sensitive data like resource limits, mounted volume paths etc… For example:

curl -X POST http://localhost:8080/api/proxy/demo

will return:


Most importantly, this is not limited to the host machine, but can also happen with public apps accessed remotely. For example, a request to will return the information on the demo app hosted on the host.

Obviously, this is a HUGE security risk; the app properties can be exploited to gain access to the host server or perform attacks.

From the documentation, I understand that the proxy API is controlled by the same authentication as shinyproxy in general; which means that, a publicly available app for general use (where no username/password authentification is set) is unprotected.

I also checked the Oauth example (; this is not a solution, as it provides protection only for the port handled by the nodejs app; the original shinyproxy port will still be unprotected.

Is there a way to somehow mask that particular part of shinyproxy so that it is not publicly accessible?

Ok, I eventually figured out how to solve this myself. Just for posterity, I am listing my solution here, so that anyone facing the same issue might benefit from it.

  1. Configure your host machine so that the port assigned to shinyproxy is only accessible from the localhost. In Linux, you can do this with iptables and ip6tables for IPv4 and IPv6, respectively.

  2. Use apache2 (or nginx, or anything else) to write proxy settings and forward shinyproxy. Example settings are the following:

  RewriteEngine on
  RewriteCond %{HTTP:Upgrade} =websocket
  RewriteRule /(.*) ws://$1 [P,L]
  RewriteCond %{HTTP:Upgrade} !=websocket
  RewriteRule /(.*)$1 [P,L]
  ProxyRequests Off
  ProxyPreserveHost On
  ProxyPass /
  ProxyPassReverse /
  1. Add the following additional lines to block access to /api/proxy:
<ProxyMatch "/api/proxy/(.*)" >
    Order Deny,Allow
    Deny from all


Thanks for sharing your solutions. Indeed we use a similar config for such deployments.
Nevertheless, I think we can document this behavior better and also provide a built-in option to hide sensitive (or most) parts of the API. I created an internal issue for this.

Note that this might break some features of ShinyProxy. For example, the switch-instance, stop and restart buttons will not work properly. However, typically these features are not used in a public deployment.

1 Like