[Bug]: Artifact wall always 403s on desktop because the server binds 0.0.0.0
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
Research direction
Start at the GET /api/artifact-wall/list handler and the localRequest generator it uses. Read how ServerConfig.host and HttpServerRequest headers are obtained, and what isLoopbackHostname accepts. Change the check to derive locality from the request URL plus absence of x-forwarded-for, x-forwarded-host and forwarded, leaving the 0.0.0.0 bind untouched. Verify with tests or curl that loopback succeeds (and bad tokens become 401), while non-loopback and forwarded requests still get 403.
Written by the indexing model from the issue text.
Description
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.
- Dominant language
- TypeScript
- Stars
- 24.8k
- Forks
- 6.4k
- Avg merge
- 1h 13m
- Merged PRs (30d)
- 584
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pingdotgg/t3code
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
⌘K: first ↓ keeps the top result selected, so moving down takes two pressesPossibly taken @2SinceJuly claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
pingdotgg/t3code#42253 · 1 comment ·
Maintainers usually reply within 1 day
-
via-triage
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
bug needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
All issues in pingdotgg/t3code
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
GetStream/stream-chat-react#3467 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
vercel-labs/ui#1139 ·
Maintainers usually reply within 1 day
-
generate_image reference URL guard lets through IPv4-mapped IPv6 hosts and 100.64.0.0/10Possibly taken @goranai claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bot:ai-assisted component:platform-js status:untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
midnightntwrk/platform-js#93 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100