Go proxy allows websocket attach (GET /containers/{name}/attach/ws), giving stdin access to containers
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 48/100
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 2
- フォーク
- 0
- 平均マージ
- 16時間 14分
- マージ済み PR(30日)
- 25
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
ChainSafe/docker-socket-policy のほかの issue
-
Priority: P2 Type: Bug
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
ChainSafe/docker-socket-policy#70 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Type: Feature
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
ChainSafe/docker-socket-policy#65 ·
メンテナーはふだん 1 日以内に返信
-
Type: Enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 38/100
ChainSafe/docker-socket-policy#46 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
ChainSafe/docker-socket-policy の issue をすべて見る
似ている issue
-
install.ps1: Windows PowerShell 5.1 aborts after a successful cosign verification (NativeCommandError on 'Verified OK')対応中かも @sly321-pixel が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
ai_p2
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
ClickHouse/ClickHouse#125522 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
[Bug]: OpenRouter streaming chunks report the requested router name instead of the model OpenRouter served対応中かも @Mrun25 が今日担当しました。 オープンbug llm translation
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
BerriAI/litellm#46095 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
cline/mcp-marketplace#2942 ·