On a typical Docker host, yes. Every container can open a connection to the host itself and to anywhere on the internet. An app that is taken over through a bug can then reach the deploy panel listening on the host, the Docker control socket or the cloud metadata address, and it can send your data out to any server. Most teams cannot answer a simple question after an incident: what did that container connect to last night?
Two things to do.
- Refuse new connections from app containers to the host. A web app has no reason to call the machine it runs on. The few that do (a monitoring agent, a relay) go on a short written list of exceptions. Re-apply the rule after a container is recreated, because its address changes on every deploy.
- Record outbound traffic per container and summarise it daily: which container reached which destination, and how often. The list of destinations for a web app is short and stable (a package registry at build time, its database, one or two APIs), so a destination that was never seen before is easy to spot, and whoever is on watch can read it.
For a container that runs code or queries from strangers, go further and deny all outbound traffic. Test from inside the container. The firewall listing can look right while stale, so try to reach the host's panel port from inside the container. It must fail.
Related: can attackers bypass Cloudflare and hit my server directly? Full item: the Server section of the security checklist.
Building something like this? How I work covers the rates, the availability and what I take on.