Repository navigation
Description
Finding
PR #4419 fixed the reflected-XSS class from issue #2267 in pm-stack/aggregator/src/server.ts (unknown /item/<subject>, quota-service id, and program project id 404s now pass through the renderer's esc helper), but its body explicitly left the same reflection class open in a sibling module:
Out of scope / not touched:
error-boundary.tsnotFoundResponseinterpolates the raw page path into its HTML 404 (<code>${path}</code>) — same reflection class, reachable for unknown page routes. Left alone per this task's server.ts-only scope; happy to file a follow-up if wanted.
That follow-up was never filed. Verified live on current main (8ea5e0040918) on 2026-11-16: pm-stack/aggregator/src/error-boundary.ts:22-33 still reads
export function notFoundResponse(path: string): Response {
...
return new Response(`<h1>Not found</h1><p class="muted">no page at <code>${path}</code></p>`, {
status: 404,
headers: { "content-type": "text/html; charset=utf-8" },
});
}The file contains no escaping helper or import at all (grep for esc( on main returns only the notFoundResponse lines). The JSON branch is safe (JSON-encoded); only the HTML page-route branch reflects the raw path.
Why it matters
This is the exact class issue #2267 was filed and fixed for — an unescaped, request-derived value interpolated into an HTML response served from the aggregator origin. #4419 closed the class in server.ts and documented this remaining instance; leaving it open means the class is not actually closed, and the next audit has to rediscover it. Escaping here is the same one-line treatment the sibling 404s received.
Evidence
- PR fix(pm-aggregator): escape unknown /item subjects against reflected XSS #4419 (merged, merge commit
d1628b4beeec), body section "Out of scope / not touched" quoted above. - Issue security(pm-aggregator): reflected XSS — decoded /item/<subject> interpolated unescaped into the not-found HTML response (Codex P1 on #856, still on main) #2267 (CLOSED by fix(pm-aggregator): escape unknown /item subjects against reflected XSS #4419) — the original reflected-XSS finding for the same response family.
- Current main:
pm-stack/aggregator/src/error-boundary.ts:29—`<code>${path}</code>`with no escaping, read via the contents API at main8ea5e00409186c3b6e660eb620c6e8826d8f3108on 2026-11-16. - Dedupe: issue search for the error-boundary / notFoundResponse reflection on 2026-11-16 returned only security(pm-aggregator): reflected XSS — decoded /item/<subject> interpolated unescaped into the not-found HTML response (Codex P1 on #856, still on main) #2267 (closed) and unrelated decode/404 issues — no open or closed issue tracks this follow-up.
Acceptance criteria
notFoundResponse's HTML branch escapes the path with the renderer's existingeschelper (or an equivalent local escape) before interpolation; the JSON branch is unchanged.- A regression test in the aggregator suite (extending
test/error-boundary-1211.test.ts, alongside fix(pm-aggregator): escape unknown /item subjects against reflected XSS #4419's/itemcase) proves an unknown page path containing HTML metacharacters (e.g.<img src=x onerror=...>) returns 404 with the path as inert escaped text and no executable element. - Existing error-boundary tests still pass.
Found by: pr-diff-review job, 2026-11-16 run (PR #4419 review).
Activity
developing-today commentedon Nov 16, 2026
CODE-3920
dezren39 commentedon Nov 16, 2026
🤖 Agent note · filed
error-boundary.tsnotFoundResponse's HTML 404 and add the regression test.eschelper, a metacharacter regression test in the error-boundary suite, and existing tests passing.d1628b4beeec); original finding issue security(pm-aggregator): reflected XSS — decoded /item/<subject> interpolated unescaped into the not-found HTML response (Codex P1 on #856, still on main) #2267 (closed); evidence in this issue's body.dezren39 commentedon Nov 16, 2026
🤖 Agent note · triaged
Merge pull request #10866 from developing-today/queue/17548-10865-esc…
dezren39 commentedon Nov 16, 2026
🤖 Agent note · done
dezren39 commentedon Nov 16, 2026
🤖 Agent note · done (already_done)