Go proxy allows websocket attach (GET /containers/{name}/attach/ws), giving stdin access to containers
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
Start with the Go router and go/internal/proxy/transport.go, then compare the Rust and TypeScript transports. Read spec/router.qnt and the existing execNeverAllowed rule; add coverage in the three router tables and an integration check for the websocket upgrade. Done means attach paths are denied across methods and the upgrade receives the proxy's 403 in all three implementations.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
The Go proxy lets a client write to a container's stdin through a websocket attach: GET /containers/{name}/attach/ws?stdin=1&stream=1 with Upgrade: websocket. The router treats it as a read (GET passthrough), and go/internal/proxy/transport.go (httputil.ReverseProxy) passes the protocol upgrade through, so the client gets a bidirectional stream to the container. Attaching to a container whose main process is a shell is equivalent to exec, which the proxy exists to deny. This holds with and without --readonly.
Found in the review of the #75 fix (fix/readonly-router-75); not introduced by it.
Affected implementation(s)
- Go: exploitable (reproduced)
- Rust: forwards the upgrade request and relays the daemon's
101, but the connection breaks right after; no stdin reached the container - TypeScript: the request timed out; no stdin reached the container
Rust and TS are not exploitable in this probe, but both forward an attach request they should deny.
To Reproduce
docker run -d -i --name zzws busybox sh -c 'while read l; do echo "GOT:$l" >> /tmp/in.txt; done'- Run the Go proxy (
--readonlyor not) with--config-dir=deploy/config. - Over the proxy socket, send
GET /containers/zzws/attach/ws?stdin=1&stream=1 HTTP/1.1withUpgrade: websocket,Connection: Upgrade,Sec-WebSocket-Key,Sec-WebSocket-Version: 13, then one masked text framepwned-via-readonly-proxy. - Result:
HTTP/1.1 101 Switching Protocols;docker exec zzws cat /tmp/in.txtprintsGOT:pwned-via-readonly-proxy. Audit log:"decision":"ALLOW" … "path":"/containers/zzws/attach/ws".
Expected behavior
- Deny attach in the router for every method, like exec:
attachas a whole segment after/containers/{name}(covering/attachand/attach/ws), with a message such asattach is not allowed. (POST /containers/{name}/attachis already default-denied as a non-lifecycle POST; theGET …/attach/wsform is the gap.) - Refuse protocol upgrades in all three transports: strip or reject requests carrying
Upgrade/Connection: Upgrade, so no endpoint can be turned into a raw stream. Defence in depth; the Docker CLI's legitimate uses of upgrade (attach, exec start) are already denied. - Spec: an
attachdeny rule and property inspec/router.qntmirroringexecNeverAllowed; table rows in all three; an integration check that the upgrade is refused with the proxy's 403.
Alternatives considered:
- Only block upgrades in the transport. Rejected alone: the plain (non-upgrade)
POST /containers/{id}/attachhijack path should stay denied by the router too, and the router is where the spec lives. - Treat
--readonlyspecially. Rejected: the gap exists in every mode.
Environment
- Docker 29.4.0 (OrbStack); Go binary from
fix/readonly-router-75(same router/transport asmainfor this path).
Additional context
Consider a security advisory for the Go releases once fixed.
- Lenguaje dominante
- Rust
- Estrellas
- 2
- Forks
- 0
- Merge medio
- 12 h 11 min
- PR fusionados (30 d)
- 30
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de ChainSafe/docker-socket-policy
-
Type: Feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 12/100
ChainSafe/docker-socket-policy#96 ·
Los mantenedores suelen responder en 1 día
-
Priority: P3 Type: Enhancement
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
ChainSafe/docker-socket-policy#95 ·
Los mantenedores suelen responder en 1 día
-
Type: Feature
Dificultad 5/5 Más de una semana Aptitud para principiantes 25/100
ChainSafe/docker-socket-policy#65 ·
Los mantenedores suelen responder en 1 día
-
Type: Enhancement
Dificultad 5/5 Más de una semana Aptitud para principiantes 38/100
ChainSafe/docker-socket-policy#46 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de ChainSafe/docker-socket-policy
Issues similares
-
build: Update rust versionPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertodependencies
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
ibm-granite-community/granite-cli#229 ·
Los mantenedores suelen responder en 1 día
-
setTargetAtTime booked ahead of time starts its curve early (values blow up before start_time)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
orottier/web-audio-api-rs#658 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
aosama/astronomical#1318 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug: `shep kelpie finish all`Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
shep-pm/shep-kelpie#980 ·
Los mantenedores suelen responder en 1 día