[Bug]: Artifact wall always 403s on desktop because the server binds 0.0.0.0
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 72/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- node.js, typescript
調査の方向性
GET /api/artifact-wall/list ハンドラと、それが使用する localRequest ジェネレーターから始めてください。ServerConfig.host と HttpServerRequest のヘッダーがどのように取得されているか、また isLoopbackHostname が何を受け入れるかを読んでください。ローカル判定を、リクエストURLと x-forwarded-for、x-forwarded-host、forwarded が存在しないことから導出するようにチェックを変更してください。0.0.0.0 へのバインドは変更しないでください。ループバックのリクエストが成功し、不正なトークンが 401 になること、また非ループバックおよび転送されたリクエストが引き続き 403 を受け取ることを、テストまたは curl で検証してください。
索引モデルが issue の本文から書いたものです。
説明
What happens
The artifact panel shows Artifacts 0 and This connection can’t read artifacts. (Chinese UI: 此连接无权读取产物). Retry does nothing. The artifacts exist; the list endpoint rejects every request before it checks the token.
Environment
- App: T3 Code (Nightly), bundle id
com.t3tools.t3code - Version:
0.1.11-nightly.20261122.4761(CFBundleShortVersionString1.2.3) - macOS, Apple Silicon
- Server listen address:
*:3773(lsofon the desktop process)
Reproduction
From the same machine, with the desktop app running:
curl -sS -D - -o /tmp/aw.txt \
"http://127.0.0.1:3773/api/artifact-wall/list?threadId=any&scope=thread"
# HTTP/1.1 403 Forbidden, empty body
curl -sS -D - -o /dev/null \
-H "Authorization: Bearer not-a-real-token" \
"http://127.0.0.1:3773/api/artifact-wall/list?threadId=any&scope=thread"
# still HTTP 403, not 401
Both This thread and This project in the panel hit this endpoint (scope=thread and scope=project) and stop at the same 403.
Cause
Desktop startup sets the server host to all interfaces:
host: "0.0.0.0"
GET /api/artifact-wall/list returns 403 immediately when localRequest is false:
const localRequest = gen(function* () {
const config = yield* ServerConfig;
const request = yield* HttpServerRequest;
const url = toURL(request);
return isLoopbackHostname(config.host ?? "127.0.0.1")
&& Boolean(request.headers.host)
&& isSome(url)
&& isLoopbackHostname(url.value.hostname)
&& !request.headers["x-forwarded-for"]
&& !request.headers["x-forwarded-host"]
&& !request.headers.forwarded;
});
isLoopbackHostname only accepts 127.0.0.1, ::1, and localhost. 0.0.0.0 fails that check, so a request to http://127.0.0.1:3773 is refused before authenticateRawRouteWithScope runs. A missing or bad token therefore never becomes a 401.
The panel maps every 403 from this route to This connection can’t read artifacts. EnvironmentScopeRequiredError uses the same status, so a real missing orchestration:read scope and this bind-address mismatch look identical.
Expected
A request whose URL hostname is loopback, with no forwarded headers, should be allowed to list artifacts on the desktop app. Listening on 0.0.0.0 should stay as it is, so remote pairing still works. A non-loopback client, or a request that carries X-Forwarded-For / Forwarded, should still be rejected.
Suggested check: decide localRequest from the request URL and the forwarded headers, not from config.host.
- 主要言語
- TypeScript
- スター
- 24.8k
- フォーク
- 6.4k
- 平均マージ
- 1時間 27分
- マージ済み PR(30日)
- 530
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
pingdotgg/t3code のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
pingdotgg/t3code#42253 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
via-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
メンテナーはふだん 1 日以内に返信
-
bug needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
pingdotgg/t3code の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
vercel-labs/ui#1108 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 半日 初心者へのやさしさ 62/100
garethgeorge/backrest#1451 ·
メンテナーはふだん 1 日以内に返信
-
fix(core): \.pluck() returns values in key insertion order instead of requested argument order対応中かも @ManyaS-Git が 1 日前に担当しました。 オープンstatus:in-linear
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
Activity indicator ignores prefers-reduced-motion対応中かも @CapThunder19 が今日担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 85/100
joinmarket-webui/jam#1675 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 13 日以内に返信