---
title: "NET-FW-005 Container Ports Bypass the Host Firewall"
canonical: https://openvapt.com/checks/NET-FW-005.html
html: https://openvapt.com/checks/NET-FW-005.html
site: OpenVAPT, https://openvapt.com/
license: OpenVAPT Source-Available Licence 1.3, https://openvapt.com/legal/licence-text.html
modified: 2026-10-16
version: 0.1.0-alpha.6
---

# NET-FW-005 Container Ports Bypass the Host Firewall

Checks whether Docker publishes container ports through its own iptables chains with no DOCKER-USER filtering.

- Domain: Network
- Severity: Medium
- Control category: Network Exposure
- Fix effort: medium
- CVSS v3.1 vector: `CVSS:3.1/AV:N/AC:H/PR:N/UI:N/S:U/C:L/I:L/A:L`
- CIS Controls v8: 4.4
- NIST CSF 2.0: PR.IR-01
- CWE: CWE-923, CWE-1327
- OWASP Top 10 2021: A05:2021
- NIST SP 800-53 Rev. 5: SC-7, CM-7
- Benchmark topic: Filter container traffic (topic only, no benchmark text)

## Why It Matters

Docker inserts its NAT and FORWARD rules ahead of ufw and of the INPUT chain, so a port published with -p 8080:80 is reachable from the internet even when ufw says the port is denied. Administrators routinely believe the firewall protects these containers when it does not.

## How It Detects

Reads iptables -S and looks for ACCEPT rules with a destination port in the DOCKER chain (published container ports). Fails when there are such rules and the DOCKER-USER chain contains no DROP or REJECT rule.

## How to Fix

Publish container ports on loopback only (-p 127.0.0.1:8080:80) and put a reverse proxy in front, or add filtering to DOCKER-USER, for example: iptables -I DOCKER-USER -i eth0 ! -s 203.0.113.0/24 -j DROP (persist it with your firewall tooling). Caution: test from an allowed address first; a wrong interface name or source range cuts access to every published container.

## How to Verify

```
docker ps --format '{{.Ports}}'  shows 127.0.0.1 bindings, or iptables -S DOCKER-USER shows DROP rules.
```

## Learn the Theory

- [P3 Network Exposure and Firewalls](https://openvapt.com/academy/p3.md)
- [P12 Firewall Policy Versus What Is Listening](https://openvapt.com/academy/p12.md)

## References

- [Docker documentation, Packet filtering and firewalls](https://docs.docker.com/engine/network/packet-filtering-firewalls/)
- [NIST SP 800-41 Rev. 1, Guidelines on Firewalls and Firewall Policy](https://csrc.nist.gov/pubs/sp/800/41/r1/final)

## Source Code

https://github.com/OpenVAPT/openvapt/blob/574f7f3333c44b75a3c649e2d93a76d507f75adf/internal/checks/network/firewall_exposure.go

Run it: `openvapt scan --only NET-FW-005`. Read it offline: `openvapt explain NET-FW-005`.

---

OpenVAPT is academic, non-commercial, source-available and built by AI Cybersecurity Engineers (AI systems, not people). Free for your own use on machines you own or control, 100% at your own risk; not for sale and not for providing services. This page in HTML: https://openvapt.com/checks/NET-FW-005.html. Part of OpenVAPT Check Catalogue. How to cite: https://openvapt.com/cite.html. Site summary for models: https://openvapt.com/llms.txt.
