Repository navigation
Closed
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item
Description
Defect
The PM aggregator's two HTML "not found" routes return HTTP 200, while every sibling not-found route in the same handler returns 404:
pm-stack/aggregator/src/server.ts:885—/item/<unknown>:return html(\Not found
…no board item or roadmap row with subject${id}`)—html()` defaults to status 200 (server.ts:214).pm-stack/aggregator/src/server.ts:586-590—/quota/service/<unknown>: same pattern,html()with no status argument.
Contrast, same file, same run of the handler:
/program/<unknown>passes 404 explicitly (server.ts:696-697).- The JSON twins pass 404:
/api/program-project.json(server.ts:710),/api/quota/service.json(server.ts:767). - The fallthrough route returns
json({ error: "not found", path }, 404)(server.ts:888).
Verified this run (main 48f7c867cbf95e9ed51ece83ae0d68d58785ca54)
Laptop probe (fixture source, loopback only, server.ts sha256 d68163b8… identical on sandbox main and the laptop clone; probe dir ~/git/fleet/probe-2026-10-30-laneB-item404/):
| Request | Result |
|---|---|
GET /item/no-such-item-xyz |
200 |
GET /quota/service/no-such-svc |
200 |
GET /program/no-such-proj (control) |
404 |
GET /api/quota/service.json?id=nope (control) |
404 |
GET /nope-route (control) |
404 |
Why it matters
- Machine consumers, link checkers, uptime/health probes, and browser history treat these misses as successful pages; a mistyped or stale item/service link is indistinguishable from a real page by status.
fetchHandler(server.ts:~905) records a render as OK whenres.status < 400, so every hit on a missing/item/…page is recorded in the impl(aggregator): service & page health page - live probes for every stack service, feed ages, last runs #1147 render registry as a successful page render — the health page's per-page "last rendered OK" signal is polluted by not-found traffic.- The inconsistency is in-file: a reader cannot tell whether 200 is deliberate for these two routes (nothing documents it) — the explicit 404s elsewhere say it is not.
Note: the unescaped ${id} interpolation on the /item line itself is the separate, already-tracked reflected-XSS issue #2267 — this issue is only about the status code, and the two fixes touch adjacent lines, so whoever takes one should check the other.
Acceptance criteria
GET /item/<unknown>andGET /quota/service/<unknown>return 404 with the same not-found HTML bodies as today.- Known item/service pages still return 200; no other route's status changes.
- A test (aggregator suite or a handler-level check) pins both statuses, plus a 200 control for an existing item/service.
- The render registry no longer records a missing-item hit as a successful render (follows automatically from the 404 once
fetchHandler's< 400rule sees it — verify, don't assume).
Metadata
Metadata
Assignees
Labels
app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/xsTrivial: expected under 30 minutes of workkind/bugSomething isn't working (prefixed form of the classic bug label)priority/lowNice to have; do when convenientsource/creatorFiled by the new-issue-creator jobtask/triageQueue packet kind: verify, reproduce, and route this item
Activity
dezren39 commentedon Oct 31, 2026
🤖 Agent note · state: filed
~/git/fleet/probe-2026-10-30-laneB-item404/· related security(pm-aggregator): reflected XSS — decoded /item/<subject> interpolated unescaped into the not-found HTML response (Codex P1 on #856, still on main) #2267 (fresh verification comment added this run)dezren39 commentedon Nov 1, 2026
🤖 Agent note · picked up
dezren39 commentedon Nov 1, 2026
🤖 Agent note · done
5abd39af971d802ae527d939c5110d7b660fd635.html(body, status = 200)is atserver.ts:235; both unknown-route branches at:609-611and:940omit status.fetchHandlercounts HTML as a successful render only when status< 400(:955-961). The old /item probe's path decoder changed separately for aggregator: Phase 1 of #2747 — guard the two path-segment decodes (/discuss, /item) on the shared contract #2748, but its not-found return is unchanged;/quota/serviceis unchanged from the probed main.48f7c867observed both routes return 200 and sibling controls return 404. A fresh runtime probe could not start: Bun exited before listen withUnexpected exportatsrc/feed.ts:358; no files were changed.dezren39 commentedon Nov 2, 2026
Already fixed on current main — closing with evidence (task 5476, lane C). Both not-found branches now pass 404 explicitly:
pm-stack/aggregator/src/server.ts— the unknown/quota/service/<id>branch returnshtml(..., 404)and the unknown/item/<id>branch returnshtml(..., 404). Handler-level coverage already exists inpm-stack/aggregator/test/error-boundary-1211.test.ts("consistent not-found semantics over HTTP (#1211)": "/item and /quota/service misses are 404, not 200", plus known-page 200 controls). Verified fresh 2026-11-02 on the laptop at main ddd0d42:bun test test/error-boundary-1211.test.ts— 6 pass, 0 fail, against a live loopback server. The fix landed under the #1211 not-found work after this issue's evidence snapshot (5abd39a); the packet's remaining asks (bodies unchanged, misses not recorded as successful renders — fetchHandler only records status < 400) are satisfied by the same state.dezren39 commentedon Nov 2, 2026
🤖 Agent note · done