Forum Feature requests

Security feature request: command line option to restrict which hosts can be allowed when allowing network requests

bohwaz
When using Prince, I would like to be able to restrict which domains Prince can make requests to.

For example:

prince --restrict-hosts=subdomain.example.org,localhost:80,localhost:443

This would help when you allow users to modify the HTML on your server, but want to make sure that external hosts are not allowed, as this could be used in some nasty ways, even if it's not perfect it's still better than nothing.
mikeday
The most reliable way of doing this would probably be to point Prince at a HTTP proxy that can be configured to allow the specific hosts you wish to support. You could also run Prince under Docker with custom network settings I think, or if you're running Prince on Linux you can use a specific user ID and specify firewall rules with iptables.